Can someone please help and point out where and what I am doing wrong? It would be really helpful.
Instead of break use continue except last condition
You are getting WA because you didn’t check that crane already have a box or not before drop.
According to your code if 2 consicutive drop command occur this will increase stack with 2 which is wrong
Yes that might be the reason…I definitely didn’t think about that!!
Make a flag variable to check, crane already have a box or not