Python3 and JavaScript Solution easy to unsderstand
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def calPoints(self, operations: List[str]) -> int:\n        scoresAdded = []\n    \n        for op in operations:\n            if op.lstrip(\'-\').isdigit(): \n                scoresAdded.append(int(op))\n            elif op == \'C\':\n                scoresAdded.pop()\n            elif op == \'D\':\n                scoresAdded.append(scoresAdded[-1] * 2)\n            elif op == \'+\':\n                scoresAdded.append(scoresAdded[-1] + scoresAdded[-2])\n\n        return sum(scoresAdded)\n\n```\n```JavaScript []\n/**\n * @param {string[]} operations\n * @return {number}\n */\nvar calPoints = function(operations) {\n    let scoresAdded = [];\n\n    for (let op of operations) {\n        if (!isNaN(op) || (op[0] === \'-\' && !isNaN(op.slice(1)))) {\n            scoresAdded.push(parseInt(op));\n        } else if (op === \'C\') {\n            scoresAdded.pop();\n        } else if (op === \'D\') {\n            scoresAdded.push(scoresAdded[scoresAdded.length - 1] * 2);\n        } else if (op === \'+\') {\n            scoresAdded.push(scoresAdded[scoresAdded.length - 1] + scoresAdded[scoresAdded.length - 2]);\n        }\n    }\n    \n    return scoresAdded.reduce((a, b) => a + b, 0);\n};\n```\n
['Python3', 'JavaScript']