THIS IS THE QUESTION LINK
CLICK HERE
THIS IS MY ANSWER LINK
CLICK HERE
I DONT KNOW WHAT IS THE ERROR BZ THE PROGRAM IS WORKING FOR GIVEN TEST CASES AND ALSO OTHER CASES
CAN ANYONE CORRECT MY CODE AND SEND…
THIS IS THE QUESTION LINK
CLICK HERE
THIS IS MY ANSWER LINK
CLICK HERE
I DONT KNOW WHAT IS THE ERROR BZ THE PROGRAM IS WORKING FOR GIVEN TEST CASES AND ALSO OTHER CASES
CAN ANYONE CORRECT MY CODE AND SEND…
Why there are so many loops there… -_- and two loops have same variable j too… one for loop should be sufficient… https://www.codechef.com/viewsolution/14389395
The j variable gets overwritten within the second loop…
Also, this can be simplified into 3 steps…
(https://www.codechef.com/viewsolution/14732502) for more clarification (just check the comments, you can ignore the codes).