Leetcode Counting Sort Geeksforgeeks Javascript