Verbose Java solution, LinkedList
\nclass Solution {\n    public int calPoints(String[] ops) {\n        int sum = 0;\n        LinkedList<Integer> list = new LinkedList<>();\n        for (String 
```\nclass Solution {\n    public int calPoints(String[] ops) {\n        int sum = 0;\n        LinkedList<Integer> list = new LinkedList<>();\n        for (String op : ops) {\n            if (op.equals("C")) {\n                sum -= list.removeLast();\n            }\n            else if (op.equals("D")) {\n                list.add(list.peekLast() * 2);\n                sum += list.peekLast();\n            }\n            else if (op.equals("+")) {\n                list.add(list.peekLast() + list.get(list.size() - 2));\n                sum += list.peekLast();\n            }\n            else {\n                list.add(Integer.parseInt(op));\n                sum += list.peekLast();\n            }\n        }\n        return sum;\n    }\n}\n```
[]