public int evalRPN(String[] tokens) {
Stack<Integer> stack1 = new Stack<>();
for (String s:tokens) {
if(s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/")){
int a = stack1.pop();
int b = stack1.pop();
switch (s){
case "+": b+=a;break;
case "-": b-=a;break;
case "*": b*=a;break;
case "/": b/=a;break;
}
stack1.push(b);
}
else stack1.push(Integer.valueOf(s));
}
return stack1.peek();
}