Techinpad: [LeetCode] Basic Calculator II
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, + , - , * , / You may assume that the given expression is always valid. Some examples: "3+2*2" = 7 " 3/2 " = 1 " 3+5 / 2 " = 5 Note: Do not use the eval built-in library function. Note: What can be done through stl stack, can also be done through stl vector. class Solution { public: int calculate(string s) { vectorRead full article from Techinpad: [LeetCode] Basic Calculator II
No comments:
Post a Comment