n=int(input())
x=[]
y=[]
z=[]
for i in range(0,n):
a,b=map(int,input().split())
x.append(a)
y.append(b)
temp=0
for j in range(len(x)):
l=0
if(x[j]>=y[j]):
l=x[j]-y[j]
z.append(l)
if(l>temp):
temp=l
e=‘x’
else:
l=y[j]-x[j]
z.append(l)
if(l>temp):
temp=l
e=‘y’
n=max(z)
if(e==‘x’):
w=1
else:
w=2
print(w,n)
You must have missed some of the boundary cases or other test cases. Also, please share the problem code when referring to a problem.
You’re given the round-by-round scores, but you need to check the lead after each round in the cumulative score.