You're given a string num containing only digits and an integer target. Insert +, -, or * between the digits (no unary operators) to form expressions that evaluate to target. Return all such expressions. Meta asks this backtracking problem to test your ability to handle complex recursive state.
For example, num = "123" and target = 6 gives ["1+2+3", "1*2*3"].
The hard part is handling multiplication. Because * has higher precedence, 2+3*4 is , not . How do you handle precedence without building a full expression tree?
Constraints: num, digits only, .