Quick Overview

Return every expression formed by placing plus or times between adjacent numbers, kept in order, that equals a target under standard operator precedence. Results are sorted lexicographically, testing enumeration of operator choices and correct handling of multiplication binding tighter than addition.

List All Plus/Times Expressions Reaching a Target Under Operator Precedence

Company: Pinterest

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Overview: Return every expression formed by placing plus or times between adjacent numbers, kept in order, that equals a target under standard operator precedence. Results are sorted lexicographically, testing enumeration of operator choices and correct handling of multiplication binding tighter than addition.

Read the full Pinterest Software Engineer interview experience this question came from

Loading…