The Lead Game: Pls help me correct it.

The code below is my solution for the Lead Game problem. I tried testing the solution with sample input. It works fine with that but it doesn’t get accepted. Please help me correct my mistake if there are any.

import sys
 
N_cases = raw_input()
list = []
for i in range(int(N_cases)):
	pl1sc,pl2sc = raw_input().split()
	list.append(int(pl1sc) - int(pl2sc))
 
pl1lead = max(list)
pl2lead = min(list) * -1
 
if pl1lead>pl2lead :
	W = 1
	L = pl1lead
	print W, L
else:
	W = 2;
	L = pl2lead
	print W, L

Got the answer.

I had to add previous rounds score while finding the lead in the current round. I didn’t do that so I was getting that error.

1 Like