You are viewing a single comment's thread. Return to all comments →
Python solution with enumerate():
def countSort(arr): final_list = [[] for k in range(len(arr))] for count,value in enumerate(arr): if count < len(arr)//2: final_list[int(value[0])].append('-') else: final_list[int(value[0])].append(value[1]) print(' '.join([j for k in final_list for j in k]))
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →
Python solution with enumerate():