Practice Expression Add Operators
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given a string num that contains only digits and an integer target, return all possibilities to insert the binary operators '+', '-', and/or '*' between the digits of num so that the resultant expression evaluates to the target value. Note that operands in the returned expressions should not contain leading zeros. Note that a number can contain multiple digits.
Source: Expression Add Operators on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
num = "123", target = 6
["1*2*3","1+2+3"]
# Example 2
num = "232", target = 8
["2*3+2","2+3*2"]
# Example 3
num = "3456237490", target = 9191
[]
Constraints
Related LeetCode Problems
Practice more problems similar to Expression Add Operators.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.