Counting Sort 2

  • + 0 comments
    def countingSort(arr):
        # Write your code here
        res=[0]*(max(arr)+1)
        s=[]
        for i in arr:
            res[i]+=1
        for i in range(len(res)):
            s.extend([i]*res[i])
        return s