Alternative solution. passed all test cases


#1

expr = []
oper = [’+’,’-’,’/’,’*’]

    i = len(A)-1
    while len(A) > 1:
        while i >= 0 :
            
            if A[i] in oper :
                if A[i-1] not in oper and A[i-2] not in oper :
                    expr.append(str(int(eval(A[i-2] + A[i] + A[i-1]))))
                    i = i - 3
                else:
                    expr.append(A[i])
                    i = i - 1
            else:
                expr.append(A[i])
                i = i - 1
            #print (expr,i)
        A = expr[::-1]
        expr = []
        #print (A)
        i = len(A)-1
    return A[0]