Initial solution to counting sort (segmentation error on big test cases still).