name on an old keyboard. Sometimes a key sticks, and the letter comes out several times in a row instead of once. The keyboard makes no other mistakes: letters are never lost, swapped or added out of nowhere.
You see what ended up on the screen, the string typed. Return True if it could have come from typing name (possibly with no sticking at all), and False otherwise.name='mila', typed='mmiilaaa' → True
The m, i and a keys stuck: every letter of the name appears at least as many times as needed, and nothing extra was typed.
name='anna', typed='ana' → False
The name has two n's in a row, but only one was typed. A sticky key can add letters, never drop them.
name='leo', typed='leeoz' → False
There is no z in the name at all, so no sticky key could have produced it.
name and typed consist of lowercase English lettersname='mila', typed='mmiilaaa'
True
Run checks the first 3 tests in your browser. Submit checks all 142 tests on the server, hidden ones included.