WA in INPSTFIX

I am getting wrong answer for infix to postfix
My solution: CodeChef: Practical coding for everyone

For each operator, you should pop out all the operators which are currently present in the stack, of precedence greater than or equal to the current operator. In your code, you are only checking for the operator which is present on top of the stack and not for the other operators present in the stack. I modified your code a bit to change the if conditions to while conditions and it received an AC.

Thanks @anon49701446 I was also doing the same mistake.