Quick Overview

Insert addition, subtraction, multiplication, and parentheses between numbers kept in their original order to reach a target. Use every input exactly once and return the lexicographically smallest fully parenthesized valid expression, or an empty string when none exists.

Build an Expression That Reaches a Target

Company: Waymo

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Insert addition, subtraction, multiplication, and parentheses between numbers kept in their original order to reach a target. Use every input exactly once and return the lexicographically smallest fully parenthesized valid expression, or an empty string when none exists.

Loading…