@@ -0,0 +1,1181 @@
+/***%0A * Evaluate the value of an arithmetic expression in Reverse Polish Notation.%0A *%0A * Valid operators are +, -, *, /. Each operand may be an integer or another expression.%0A *%0A * Some examples:%0A *   %5B%222%22, %221%22, %22+%22, %223%22, %22*%22%5D -%3E ((2 + 1) * 3) -%3E 9%0A *   %5B%224%22, %2213%22, %225%22, %22/%22, %22+%22%5D -%3E (4 + (13 / 5)) -%3E 6%0A */%0Apublic class Solution %7B%0A    public int evalRPN(String%5B%5D tokens) %7B%0A        int x, y;%0A        Stack%3CInteger%3E st = new Stack%3CInteger%3E();%0A        for (int i = 0; i %3C tokens.length; i++) %7B%0A            if (isOperator(tokens%5Bi%5D))%0A                st.push(calc(st.pop(), st.pop(), tokens%5Bi%5D));%0A            else %0A                st.push(Integer.parseInt(tokens%5Bi%5D));%0A        %7D%0A        return st.pop();%0A    %7D%0A%0A    private boolean isOperator(String s) %7B%0A        String str = new String(%22+-*/%22);%0A        return s.length() == 1 && str.indexOf(s.charAt(0)) != -1;%0A    %7D%0A%0A    private Integer calc(int num2, int num1, String op) %7B%0A        switch (op.charAt(0)) %7B%0A            case '+':   return num1 + num2;%0A            case '-':   return num1 - num2;%0A            case '*':   return num1 * num2;%0A            case '/':   return num1 / num2;%0A            default:   return 0;%0A        %7D%0A    %7D%0A%7D%0A

add EvaluateReversePolishNotation.java