Solving using counting sort

In soln following given in the problem , a different method other than counting sort has been used to solve the problem.Why is counting sort not used as it also sorts in linear time.

hi
there are diff method to solve a prblm u can also use counting sort if u have to sort in linear time