def evalRPN(tokens): intList =  for i in tokens: if i.isdigit(): intList.append(i) else: int1 = intList.pop() int2 = intList.pop() intList.append(str(eval(int2 + i + int1))) return int(intList.pop())
I ran into the problem that "eval" doesn't work either. What can we use in lieu of "eval"?
OJ doesn't support eval or exec in python, it recommend more native solution for interview.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.