Counting Sort 1

  • + 0 comments

    Swift ; ıf you r swift dev just follow or contact me

    func countingSort(arr: [Int]) -> [Int] {
        
        var countingArray = [Int](repeating: 0, count: 100)
        
        for num in arr{
            countingArray[num] += 1
        }
        
        return countingArray
    }