medium - accepted / - tried
In 119. create a tokenizer, you are able to extract the tokens from a string with invalid spaces.
calculate() the result of the string. You can use the tokenizer you wrote before.
calculate('1 * (20 - 300 ) ') // -280 calculate(' 1/0 ') // Infinity
- the input expression is syntactically valid, containing non-negative integers,
- Don't use
Let's try to solve this problem within 30 minutes.