We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4822fee + ae456be commit 2dbb2f6Copy full SHA for 2dbb2f6
BuiltIns/AthleteSort.py
@@ -0,0 +1,23 @@
1
+'''
2
+Title : Athlete Sort
3
+Subdomain : Built-Ins
4
+Domain : Python
5
+Author : Atharva Shah
6
+Created : 3 April 2021
7
+Problem : https://www.hackerrank.com/challenges/python-sort-sort/problem
8
9
+
10
+import sys
11
12
+if __name__ == "__main__":
13
+ n, m = input().strip().split(' ')
14
+ n, m = [int(n), int(m)]
15
+ arr = []
16
+ for arr_i in range(n):
17
+ arr_t = [int(arr_temp) for arr_temp in input().strip().split(' ')]
18
+ arr.append(arr_t)
19
+ k = int(input().strip())
20
21
+ sorted_arr = sorted(arr, key = lambda x : x[k])
22
+ for row in sorted_arr:
23
+ print(' '.join(str(y) for y in row))
0 commit comments