Space Efficient counting sort