Given characters and how often each occurs, build a Huffman tree and return each character's code — building the codes while the tree is built.
Given characters and how often each occurs, build a Huffman tree and return each character's code — building the codes while the tree is built.
Opens with the full question.