Two Solutions in Python 3 (beats ~99%)
With Stack:\n\nclass Solution:\n    def calPoints(self, s: List[str]) -> int:\n    \tp = []\n    \tfor i in s:\n    \t\tif i == \'C\': p.pop()\n    \t\telif i =
_With Stack:_\n```\nclass Solution:\n    def calPoints(self, s: List[str]) -> int:\n    \tp = []\n    \tfor i in s:\n    \t\tif i == \'C\': p.pop()\n    \t\telif i == \'D\': p.append(2*p[-1])\n    \t\telif i == \'+\': p.append(p[-1]+p[-2])\n    \t\telse: p.append(int(i))\n    \treturn sum(p)\n\t\t\n\n\n```\n_Without Stack:_\n```\nclass Solution:\n    def calPoints(self, s: List[str]) -> int:\n    \ts, i = [int(s[i]) if s[i] not in \'CD+\' else s[i] for i in range(len(s))]+[\'\'], 1\n    \twhile s[i] != \'\':\n    \t\tif s[i] == \'C\':\n    \t\t\tdel s[i-1], s[i-1]\n    \t\t\ti -= 1\n    \t\t\tcontinue\n    \t\ti += 1\n    \tfor i in range(len(s)-1):\n    \t\tif s[i] == \'D\': s[i] = 2*s[i-1]\n    \t\tif s[i] == \'+\': s[i] = s[i-2] + s[i-1]\n    \treturn sum(s[:len(s)-1])\n\t\t\n\n\n- Junaid Mansuri\n(LeetCode ID)@hotmail.com
['Python', 'Python3']