public int evalRPN(String[] tokens) {
        Stack<Integer> stack = new Stack<Integer>();
        int result = 0;
        for (String t : tokens) {
            if ((t.charAt(0) == '-' && t.length() > 1) || (t.charAt(0) >= '0' && t.charAt(0) <= '9')) {
                stack.push(Integer.parseInt(t));
            } else {
                int a = stack.pop();
                int b = stack.pop();
                switch (t.charAt(0)) {
                    case '+':
                        result = (b + a);
                        break;
                    case '-':
                        result = (b - a);
                        break;
                    case '*':
                        result = (b * a);
                        break;
                    case '/':
                        result = (b / a);
                        break;
                }
                stack.push(result);
            }
        }
        return stack.pop();
    }