C++ || vector || without using stack || easy approach
function which we used\n1. vector.push_back( n ) : insert an element n at the last in the vector.\n2. vector.pop_back() : delete an element from the last of the
function which we used\n1. **vector.push_back( n )** : insert an element n at the last in the vector.\n2. **vector.pop_back()** : delete an element from the last of the vector.\n3. **stoi( ops[i] )** : convert the string value in to the integer.\n\n\t**CODE :**\n\n```\n\t\t\t\t/* If you find this helpful upvote please */\nclass Solution {\npublic:\n    int calPoints(vector<string>& ops) {\n        int n = ops.size() , sum = 0 ;\n\t\tint k = 1; // we use this variable for the indexing of ans vector.\n        vector<int> ans;\n        ans.push_back(stoi(ops[0])); //it is certain that first element should be inserted for any other operation.\n        for(int i = 1 ; i < n ;i ++) //we run a loop from index 1 to last.\n        {\n            if(ops[i] == "D")\n            {\n                ans.push_back(ans[k - 1] * 2);\n                k ++;\n            }\n            else if(ops[i] == "C")\n            {\n                ans.pop_back();\n                k --; //we decrement an index because we remove an element.\n            }\n            else if(ops[i] == "+")\n            {\n                ans.push_back(ans[k - 1] + ans[k - 2]);\n                k ++;\n            }\n            else\n            {\n                ans.push_back(stoi(ops[i]));\n                k ++;\n            }\n        }\n        for(int j = 0 ; j < ans.size() ; j ++)\n        {\n            sum = sum + ans[j];\n        }\n        return sum;\n    }\n};\n\t\t\t\t\t\t\t\t// Thank You\n```
['C++']