Solution 1: accepted: 12ms 86%
As long as we realize this question is best resolved using stacks, we should be fine. So we need to be clear about when to use stack: When we scan from left to right and always need to look back.
|
|
How to convert standard arithmetic expressions to Reverse Polish Notation(RPN), aka postfix notation?