Simple If-else Solution C++
\n    int calPoints(vector<string>& ops) {\n        string ch="";\n        vector<int> rec;\n        for(int i=0;i < ops.size();i++)\n        {\n            ch 
```\n    int calPoints(vector<string>& ops) {\n        string ch="";\n        vector<int> rec;\n        for(int i=0;i < ops.size();i++)\n        {\n            ch = ops[i];\n            int n = rec.size();\n            if(ch=="C")\n            {\n                rec.pop_back();\n            }\n            else if(ch=="D")\n            {\n                int ele = rec[n-1]*2;\n                rec.push_back(ele);\n            }\n            else if(ch=="+")\n            {\n                int ele = rec[n-1] + rec[n-2];\n                rec.push_back(ele);\n            }\n            else\n            {\n                int num = stoi(ch);\n                rec.push_back(num);\n            }\n        }\n        int sum=0;\n        for(auto i : rec)\n        {\n            sum+=i;\n        }\n        return sum;\n    }\n```
['String', 'C']