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); `