Change counting sort implementation, just get to know why counting sort is stable, accumulative sum should be calculated during counting sort.