One of the solution is getting accepted and another is not for the question https://www.codechef.com/LRNDSA02/problems/PSHOT
This is the code which is not getting accepted
https://www.codechef.com/viewsolution/48047424
This is the code which is getting accepted
https://www.codechef.com/viewsolution/48047705
Any help or suggestion will be appreciated. Thanks.