Open jmpark0118 opened 3 years ago
if __name__ == '__main__':
n, m = map(int, input().split())
arr = []
for _ in range(n):
arr.append(tuple(map(int, input().rstrip().split())))
k = int(input())
arr_sort = sorted(arr, key = lambda x: x[k])
for i in arr_sort:
print(*i)
if __name__ == '__main__':
n, m = map(int, input().split())
arr = [input() for _ in range(n)]
k = int(input())
for row in sorted(arr, key = lambda x: int(x.split()[k])):
print(row)
출처 : https://www.hackerrank.com/challenges/python-sort-sort/problem