You are viewing a single comment's thread. Return to all comments →
python solution
def countSort(arr): n = len(arr) sort = [ [ ] for _ in range(n)] for i, pair in enumerate(arr): if i < n// 2: pair[1] = "-" sort[int(pair[0])].append(pair[1]) print(" ".join([char for line in sort for char in line]))
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 →
python solution