public int evalRPN(String[] tokens) {
        if(tokens == null || tokens.length == 0) return 0;
        Deque<Integer> deque = new ArrayDeque<Integer>();
        HashSet<String> ops = new HashSet<String>();
        Collections.addAll(ops, "+", "-", "*", "/");
        for(String str : tokens){
            if(!ops.contains(str)){
                deque.push(Integer.valueOf(str));
            }else{
                int op1 = deque.pop();
                int op2 = deque.pop();
                if(str.equals("+")) {
                    deque.push(op1+op2);
                }else if(str.equals("-")){
                    deque.push(op2 - op1);
                }else if(str.equals("*")){
                    deque.push(op1*op2);
                }else{
                    deque.push(op2 / op1);
                }
            }
        }
        return deque.pop();
    }