Athlete Sort

  • + 0 comments
        sorted_arr = [arr[i][k] for i in range(n)]
        
        sorted_arr.sort()
        
        for x in sorted_arr:
            j = 0
            while arr[j][k] != x:
                j += 1
            print(*arr[j])
            arr.pop(j)