Counting Sort 2

  • + 0 comments

    Python3

    def countingSort(arr):
        # Write your code here
        
        freq = [ arr.count(i) for i in range(max(arr))]
        
        x = [ num for num,count in enumerate(freq) for i in range(count)]
            
        return x