Search
⌘K

Leetcode 964. Least Operators to Express Number

Given x and a target, form an expression using only repeated x's combined with +, -, *, / (no parentheses, standard precedence) that equals target and uses the fewest operators. The core challenge is choosing how to build needed powers of x and combine them (add/subtract) — typically solved by a DP/recurrence on the base-x digit decomposition with handling of carries/borrows.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.