def RankTeams(arr):          for i in range(len(arr)):                        if(arr[i][0] == arr[i][1]):            print(“Invalid”)            return                            arr[i][2] = int(arr[i][2])        arr[i][3] = int(arr[i][3])          table = {}              for i in range(len(arr)):                                li1 = [0] * 4                                  li2 = [0] * 4                  if arr[i][0] in table:            li1 = table[arr[i][0]]                              if arr[i][1] in table:            li2 = table[arr[i][1]]                  li1[2] += arr[i][2]                          li1[3] += arr[i][3]                  li2[2] += arr[i][3]                          li2[3] += arr[i][2]                  li1[1] = li1[2] – li1[3]        li2[1] = li2[2] – li2[3]                  if(arr[i][2] == arr[i][3]):            li1[0] += 1            li2[0] += […]

Continue Reading