WA in INPSTFIX

https://www.codechef.com/viewsolution/33426509.

My this solution got accepted, but this do not took care of right to left precedence of ‘^’… try this : 1 5 a^b^c output should be abc^^. which is not.

I fixed it here but it is showing wrong answer.
https://www.codechef.com/viewsolution/33415558.

help.

Precedence of ^ is left to right
check at the end of this page (https://www.geeksforgeeks.org/operator-precedence-and-associativity-in-c/)

1 Like

How do we know this ‘^’ is xor not ‘^’ exponentiation operator?
Try converting them here.

^ is xor operator in programming (it is exponentiation operator in mathematics). Problem setter should have mentioned this.

1 Like