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/pxdra Dec 18 '15
Can you think of anything easier than bnf tree?