presses. For example, the word "bob" turns into "2266622".
Return how many different messages could produce this string. The answer can be huge, so return it modulo 10⁹ + 7.presses='4433' → 4
"44" is "gg" or "h", and "33" is "dd" or "e". That makes 2 · 2 = 4 messages: "ggdd", "gge", "hdd", "he".
presses='7777' → 8
Key 7 carries four letters, so four presses can also be the single letter "s". The splits of 4 are 1+1+1+1, 1+1+2, 1+2+1, 2+1+1, 2+2, 1+3, 3+1 and 4: eight in total.
presses='2' → 1
presses consists only of digits 2 through 9presses='4433'
4
Run checks the first 3 tests in your browser. Submit checks all 40 tests on the server, hidden ones included.