Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2266. Count Number of Texts
Given a string of pressed keys (digits 2–9), count how many original letter messages could produce it, where consecutive identical digits can be grouped into letters requiring 1–3 presses (or 1–4 presses for keys 7 and 9). Compute the total number of valid partitions modulo 1e9+7 (typical solution: DP over runs with per-key max group length, n up to 1e5).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.