PROGCAP Hiring | Off-Campus OA (2024) | Count Number of Texts

Question · Posted Jun 2026

Problem: Count Number of Texts Alice uses an old mobile keypad:   2 -> abc 3 -> def 4 -> ghi 5 -> jkl 6 -> mno 7 -> pqrs 8 -> tuv 9 -> wxyz A sequence of repeated digits can represent multiple possible texts. Return the total number of possible original messages modulo: Example Input pressedKeys = "22233" Output 8 Explanation Possible interpretations include: aaadd abdd bdd ... Total valid messages = 8

The full answer & interview discussion are available to premium members.

Log in Create a free account