public int evalRPN(String[] tokens) {
        Stack<Integer> stack = new Stack<Integer>();

        for (String s : tokens) {
            switch (s) {
                case "*":
                    stack.push(stack.pop() * stack.pop());
                    break;
                case "/":
                    int num = stack.pop();
                    stack.push(stack.pop() / num);
                    break;
                case "+":
                    stack.push(stack.pop() + stack.pop());
                    break;
                case "-":
                    int num1 = stack.pop();
                    stack.push(stack.pop() - num1);
                    break;
                default:
                    int val = Integer.parseInt(s);
                    stack.push(val);
            }
        }
        return stack.pop();
    }