I think my solution for PLAYFIT is right but codechef doesn’t think so. i donno what is wrong so kidly help me in this situation
Here’s link to solution : My Solution
I think my solution for PLAYFIT is right but codechef doesn’t think so. i donno what is wrong so kidly help me in this situation
Here’s link to solution : My Solution
You are only considering difference between adjacent elements. Consider following Test Case
He plays 3 matches and his score is as follows.
2 3 4
In this case, correct answer is (4-2) while your program will give 1.
You might have a look at my submission After giving it another try.