Easy Understandable code JAVA
\n\n# Code\n\nclass Solution {\n    public int calPoints(String[] opr) {\n        int n=opr.length;\n        Stack<Integer> st=new Stack<>();\n        for(int i
\n\n# Code\n```\nclass Solution {\n    public int calPoints(String[] opr) {\n        int n=opr.length;\n        Stack<Integer> st=new Stack<>();\n        for(int i=0;i<n;i++){\n            if(opr[i].equals("+")){\n                int a=st.pop();\n                int b=st.pop();\n                int c=a+b;\n                st.push(b);\n                st.push(a);\n                st.push(c);\n            }\n            else if(opr[i].equals("D")){\n                int a=st.peek();\n                int x=a*2;\n                st.push(x);\n            }\n            else if(opr[i].equals("C")){\n                st.pop();\n            }\n            else{\n                st.push(Integer.parseInt(opr[i]));\n            }\n        }\n        int sum=0;\n        while(!st.isEmpty()){\n            sum+=st.pop();\n        }\n        return sum;\n    }\n}\n```
['Java']