From 8c8b6b98bdf047304630fa80110c1dd423a12fc7 Mon Sep 17 00:00:00 2001 From: Ritik Patel <51042237+ritikpatel003@users.noreply.github.com> Date: Sat, 2 Oct 2021 12:43:12 +0530 Subject: [PATCH] Create TheFootballLeague.py --- TheFootballLeague.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 TheFootballLeague.py diff --git a/TheFootballLeague.py b/TheFootballLeague.py new file mode 100644 index 0000000..ec96136 --- /dev/null +++ b/TheFootballLeague.py @@ -0,0 +1,25 @@ +#link of the question: https://www.hackerearth.com/problem/algorithm/khoka-and-the-football-league/ +for T in range(int(input())): + n=int(input()) + d={} + p={} + gc={} + d[-1]='' + for i in range(n): + a=list(input().split()) + gd=int(a[1])-int(a[3]) + if gd>=0: + if(gd in gc): + gc[gd]+=1 + else: + gc[gd]=1 + d[gd]=a[0] + goal=-1 + res=-1 + for i in list(gc.keys()): + if(goal