simple solution in c++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int calPoints(vector<string>& o) {\n        stack<int> s;\n        for(int i = 0; i < o.size();i++){\n            if(s.empty()) s.push(stoi(o[i]));\n            else{\n                if(o[i] == "+"){\n                    int x = s.top();\n                    s.pop();\n                    int y = s.top();\n                    s.push(x);\n                    s.push(x+y);\n                }\n                else if(o[i] == "C"){\n                    s.pop();\n                }\n                else if(o[i] == "D"){\n                    s.push(2*s.top());\n                }\n                else{\n                    s.push(stoi(o[i]));\n                }\n            }\n        }\n        int sum = 0;\n        while(!s.empty()){\n            sum += s.top();\n            s.pop();\n        }\n        return sum;\n    }\n};\n```
['Stack', 'C++']