Given a string of characters, return the Huffman encoding of the string.
Huffman coding is a lossless data compression algorithm. It assigns variable-length codes to input characters, with lengths based on the frequencies of the corresponding characters.