Java Solution For Beginners
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```\nclass Solution {\n    public int calPoints(String[] ops) {\n        int res = 0;\n        ArrayList<Integer> list = new ArrayList<>();\n        for(int i=0; i<ops.length;i++){\n            if(ops[i].equals("+")){\n                list.add(list.get(list.size()-1) + list.get(list.size()-2));\n            } else if(ops[i].equals("D")){\n                list.add(list.get(list.size()-1)*2);\n            } else if(ops[i].equals("C")){\n                list.remove(list.size()-1);\n            } else {\n                list.add(Integer.valueOf(ops[i]));\n            }\n        }\n        for(int i=0;i<list.size();i++){\n            res +=list.get(i);\n        }\n        return res;\n    }\n}\n```
['Java']