Codility
Codility copied to clipboard
00-prewritten_algorithms/counting_sort.cpp
I think the algorithm does not work for simple positive range. It fails with this test case:
vector<int> A { 102, 120, 101, 103 , 101, 121, 160, 140 }; counting_sort(A, 100,200);
you must pass the correct min/max values here.
counting_sort(A, 101,160)