r/csinterviewproblems • u/pxdra • Dec 18 '15
Evaluate Math Expression
As mentioned in title.
You're given a math expression in a string, return the result as an int.
Example: "10+2*3-5/2" -> 14.
Basic: four basic operations, +-*/ Bonus: parenthesis, power.
7
Upvotes
View all comments
Show parent comment
1
u/102564 Jan 18 '16
I got this exact question in an interview (parentheses and exponentiation included)