C++  Easy Solution Using Stack
\n\n# Complexity\n- Time complexity: O(N)\n\n- Space complexity: O(N)\n\n# Code\n\nclass Solution {\npublic:\n    int calPoints(vector<string>& op) {\n        s
\n\n# Complexity\n- Time complexity: O(N)\n\n- Space complexity: O(N)\n\n# Code\n```\nclass Solution {\npublic:\n    int calPoints(vector<string>& op) {\n        stack<int> st;\n        for(int i=0; i<op.size();i++){\n            \n            if(st.empty()){\n                st.push(stoi(op[i]));\n            }\n            if(op[i] == "C" ){\n                st.pop();\n            }\n            else if(op[i] == "D" ){\n                st.push(2*st.top());\n            }\n            else if(op[i] == "+"){\n                int temp = st.top();\n                st.pop();\n                int a = temp+st.top();\n                st.push(temp);\n                st.push(a);\n            }\n            else{\n                st.push(stoi(op[i]));\n            }\n        }\n\n        vector<int> v;\n        \n        int sum =0;\n        while(!st.empty()){\n            v.push_back(st.top());\n            st.pop();\n        }\n\n        for(int i=0; i<v.size()-1;i++){\n            //cout<<v[i]<<" ";\n            sum+=v[i];\n        }\n\n        return sum;\n    }\n};\n```
['String', 'Stack', 'C++']