http://www.pythonreader.com/2025/01/implementing-huffman-encoding-for.html