Solution to how many ways to encode digits to letters with some tests