SIMPLE STACK + IF ELSE C++ COMMENTED  SOLUTION
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:o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nclass Solution {\npublic:\n    int calPoints(vector<string>& ops){\n       stack<int> scores;\n        for(auto&op : ops){\n            if (op == "+"){\n                //  a new score that is the sum of the previous two scores\n               int top = scores.top();  // Get the top element of the stack\n             scores.pop();     // Remove the top element\n             int newTop = top + scores.top();  // Sum the new top (after pop) with the old top\n             scores.push(top);        // Push the previous top back onto the stack\n             scores.push(newTop);     // Push the new score (sum of the top two previous scores)\n            }else if (op == "D"){\n                // Record a new score that is double the previous score\n                scores.push(2 * scores.top());\n            }else if (op == "C"){\n                // Invalidate the previous score, removing it from the record\n                scores.pop();\n            }else{// numbers 5, 4.. \n                // Record a new score of x (convert string to integer)\n                scores.push(stoi(op));\n            }\n        }\n        int sum = 0;\n        while(!scores.empty()){\n            sum += scores.top();\n            // cout << sum <<"\\n"; return;\n            scores.pop();\n        }\n        return sum;\n    }\n};\n```
['C++']