Huffman Coding Algorithm Geeksforgeeks Javascript Practice