yesss instead of yes or nooooo instead of no.
Split a word into groups of equal adjacent letters: wowww splits into w, o, www. A draft word can be **stretched** by repeating this step any number of times: pick a group and add more copies of its letter so that the group ends up with **three or more letters**. Letters can never be removed.
You are given the string shout that the person finally typed and a list of draft words drafts. Count how many drafts can be stretched into exactly shout.
For example, hey can become heyyy, but not heyy: the yy group has two letters, fewer than three.shout="yesss", drafts=["yes", "yess", "yees", "ye"] → 2
Both yes and yess turn into yesss by stretching the s group to three letters. yees has two es while the shout has one, and letters cannot be removed. ye has no s at all.
shout="cool", drafts=["col", "cool"] → 1
The oo group in the shout has only two letters, fewer than three, so col cannot become cool. Only cool itself works, with nothing to stretch.
shout="wowww", drafts=["wow", "wwow", "owww"] → 1
shout) ≤ 100drafts) ≤ 100drafts[i]) ≤ 100shout and drafts[i] consist of lowercase English lettersshout="yesss", drafts=["yes", "yess", "yees", "ye"]
2
Run checks the first 3 tests in your browser. Submit checks all 73 tests on the server, hidden ones included.