Simple Python Solution. O(1) space complexity and O(n) time complexity
\nclass Solution:\n    def calPoints(self, ops: List[str]) -> int:\n        i = j = 0\n        while j < len(ops):\n            if ops[j] == "C":\n             
```\nclass Solution:\n    def calPoints(self, ops: List[str]) -> int:\n        i = j = 0\n        while j < len(ops):\n            if ops[j] == "C":\n                i -= 2\n            elif ops[j] == "D":\n                ops[i] = int(ops[i-1])*2\n            elif ops[j] == "+":\n                ops[i] = int(ops[i-1]) + int(ops[i-2])\n            else:\n                ops[i] = int(ops[j])\n            i += 1\n            j += 1\n        return sum(ops[:i])\n```
['Two Pointers', 'Python3']