What is wrong in my code?

For two testcases it runs perfectly, i cant find the mistake

hi @anushreemahur5 you can refer to this tutorial https://www.youtube.com/watch?v=MhQPpAoZbMc of the problem. Please save your code on ide.codingblocks.com and share the link for future reference.

https://ide.codingblocks.com/s/243468. this is the code, two of my testcases are not passing .

the ide is empty
please share valid CB ide link

https://ide.codingblocks.com/s/243468 this is the correct ide

use long long int instead of int

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

What is wrong in my code ? Please clarify

i used long long int also , still doesnt passes the testcases

Hello @anushreemahur5,

There are two mistakes in the code you have implemented.

  1. the product can result in a value larger than the range of int.

  2. Each index should be pushed at least once into the stack.

Refer to the following code for your mistakes:

Hope, this would help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.