Long Pressed Name
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Your friend types their name on a sticky keyboard. Each key press may register the character once or several times in a row, but no character is ever skipped and no unrelated character is ever inserted.
Given name and the resulting typed string, return true if typed could have come from typing name this way, and false otherwise.
Examples
Constraints
- 1 <= name.length, typed.length <= 1000
- `name` and `typed` consist of lowercase English letters
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.