C++ stack based solution.  Easy to understand.
Stack based solution.\n\nclass Solution {\npublic:\n    int calPoints(vector<string>& ops)\n    {\n        int value1;\n        int value2;\n        int ans = 0
* **Stack based solution.**\n```\nclass Solution {\npublic:\n    int calPoints(vector<string>& ops)\n    {\n        int value1;\n        int value2;\n        int ans = 0;\n        stack<int>stk;\n        \n        for(string i:ops)\n        {\n            if(i == "C")\n            {\n                stk.pop();\n            }\n            else if(i == "D")\n            {\n                stk.push(stk.top()*2);\n            }\n            else if(i == "+")\n            {\n                value1 = stk.top();\n                stk.pop();\n                value2 = stk.top();\n                stk.push(value1);\n                stk.push(value1 + value2);\n            }\n            else\n            {\n                stk.push(stoi(i)); //stoi() to convert string into integer \n            }\n        }\n        while(stk.size() != 0)\n        {\n            ans += stk.top();\n            stk.pop();\n        }\n        return ans;\n    }\n};\n```\n**Like the solution?\nPlease upvote \u30C4**
['Stack', 'C', 'C++']