please help in the lead game problem

I am trying to solve the lead game problem

I am getting correct answer for the given input but getting WA on submitting my solution

this is my solution

Thanks.

For the given testcase, your code may work…but it is not correct.

here you are storing the lead values of each round in the array lead[n].

Those lead values are actually not “arr[k][0]-arr[k][1]”…it is actually

the sum of the scores of the player1 upto the "i"th round - the sum of the scores of the player2 till "i"th round…

so take care of that lead[n]…then your code may give AC for codechef compiler also :slight_smile:

If this helps…hope you can upvote and accept the answer…

All the Best :slight_smile:

2 Likes