Counting Sort 2

  • + 0 comments

    My Python3 solution:

    def countingSort(arr: list[int]) -> list[int]:
        # Write your code here
        freq = [0] * 100
        for num in arr:
            freq[num] += 1
    
        x: list[int] = [i for i in range(100) for _ in range(freq[i])]