

S = 2 * 3 - 2
((2 * 3) - 2) = 4
(2 * (3 - 2)) = 2 , [4, 2] or [2, 4] are the solution.
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first and only line of each test case contains arithmetic expressions containing numbers and ‘+’, ‘-’, ‘*’ as operators.
For each test case print all the values that can be obtained from the expression after putting valid parenthesis.
You can print values in any order.
The output for each test case will be printed in a separate line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
3 <= len(S) <= 65
len(S) is the length of the string 'S' it is guaranteed that input has at least one operator.
Time Limit: 1 sec.
We will go through the string S from left to right if we encounter an operator we will split S across the operator and recursively solve the expression before the operator and after the operator. Then use the results of the left part and the right part to create the answer for expression.
The algorithm will be-
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers