Technical Phone Screen Question. Best way to solve?
Anonymous User
127

Given the following input string. Product the following output array. n represents the number of pieces of information that will be given. In examples below n=5 would be 3 numbers and 2 operators. Similar to calculator but I couldn't quite figure it out. Recursion and a stack?

# Input: "4 + 3 * 5", Output = [35, 19], n = 5
# Input: "8 / 2 - 4 , Output = [-4, 0], n = 5
Comments (0)