The lead game..Wrong answer...

According to what i understood the player who has the maximum lead among all the rounds is the winner.I used the same concept in the solution but it gives a ‘Wrong Answer’.Can someone please tell me where i am going wrong? Thanx in advance.
Following is the link of my code: http://ideone.com/cDrg3K

1 Like

You are calculating the difference between scores obtained in one particular round at a time.

You are supposed to calculate the difference in the cumulative scores at the end of each round, as explained in the example:

Consider the following score sheet for

a game with 5 rounds:

Round     Player 1       Player 2

  1             140                 82
  2              89                 134 
  3              90                 110 
  4              112              106
  5              88                  90  The total scores of both players,

the leader and the lead after each
round for this game is given below:
Round Player 1 Player 2 Leader Lead

  1               140           	82        Player 1     58
  2               229           	216       Player 1     13
  3               319           	326       Player 2      7
  4               431           	432       Player 2      1
  5               519           	522       Player 2      3 

The winner of this game is Player 1 as he had the maximum lead (58 at the end of round 1) during the game.

3 Likes

thanx a lot…i had overlooked this.