A bank robber is planning a major heist, and he’s managed to get the help of a dissatisfied teller at the bank in exchange for some of the loot. The robber needs to get critical information from the teller, such as the vault codes and locations, without appearing suspicious. The pair devise a scheme for passing messages. Each day, the robber will come to the bank and make a small withdrawal. The teller will pass him coins one at a time, either heads up or tails up. The sequence of heads and tails will form an encoded message. The teller will also pass a small mapping of sequences to alphabet letters that the robber can use to decode the message. To determine the map of sequences to letters, the pair have three requirements.
1. To avoid confusion while decoding, no sequence for a letter may start with the sequence for a different letter
2. The encoded message should be as short as possible
3. The mapping should contain only the letters actually used in the message
What algorithm should the pair use to determine their mapping? How might they encode the message “THE VAULT IS OPEN NOW”?
Do you love challenges? Then you will love LiveRamp. Apply now to join our team.