Practice Expressive Words
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Sometimes people repeat letters to represent extra feeling. For example: In these strings like "heeellooo", we have groups of adjacent letters that are all the same: "h", "eee", "ll", "ooo". You are given a string s and an array of query strings words. A query word is stretchy if it can be made to be equal to s by any number of applications of the following extension operation: choose a group consisting of characters c, and add some number of characters c to the group so that the size of the group is three or more. Return the number of query strings that are stretchy.
Source: Expressive Words on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "heeellooo", words = ["hello", "hi", "helo"]
1
# Example 2
s = "zzzzzyyyyy", words = ["zzyy","zy","zyy"]
3
Constraints
Related LeetCode Problems
Practice more problems similar to Expressive Words.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.