✔Simple solution, beats: 9️⃣3️⃣% - 9️⃣9️⃣%
Code\n\n/**\n * @param {string[]} operations\n * @return {number}\n */\nconst calPoints = function (operations) {\n  const records = [];\n  while (operations.le
# Code\n```\n/**\n * @param {string[]} operations\n * @return {number}\n */\nconst calPoints = function (operations) {\n  const records = [];\n  while (operations.length != 0) {\n    const op = operations.shift();\n    switch (op) {\n      case \'C\': records.pop();\n        break;\n      case \'D\': records.push(2 * records.at(-1));\n        break;\n      case \'+\': records.push(+records.at(-1) + +records.at(-2));\n        break;\n      default: records.push(+op);\n        break;\n    }\n  }\n  return records.reduce((a, b) => a + b, 0);\n};\n```
['Stack', 'JavaScript']