Variable-Length Bit Code Decoder

Algorithm · Square · Medium

You are provided with a code table in which each letter is assigned its own bit string, and these bit strings do not all have the same length. Build a decoder: given a bit string produced by encoding some text with this table, recover and return the original text it represents. Examples Example 1 Example 2

Loading the rest of the question…