We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
arr_sort = [[] for _ in range(100)]
arr_len = len(arr)
for j in range(arr_len):
f = int(arr[j][0])
s = arr[j][1]
if j < arr_len // 2:
arr_sort[f].append('-')
else:
arr_sort[f].append(s)
res = [y for x in arr_sort for y in x]
print(" ".join(res))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →
def countSort(arr):