The Full Counting Sort

  • + 0 comments

    Python Solution:

    def countSort(arr):
        ans = [[] for _ in range(n)]
        for i in range(len(arr) // 2):
            ans[int(arr[i][0])].append("-")
        for i in range(len(arr) // 2, len(arr)):
            ans[int(arr[i][0])].append(arr[i][1])
        print(" ".join(" ".join(i) for i in ans).strip())