Search⌘ K

DIY: Expressive words

Explore how to implement a function to count stretchy words relative to a given string. Understand the rules of character group extensions and apply this knowledge to solve interview problems involving string manipulation.

Problem statement

Given a string, S, and an array of words, return the number of words that are stretchy.

A word in words is stretchy with respect to S if S can be derived by extending the letters of the word. Here is the extend rule:

...