Imagine you're building a smart code editor that helps developers find functions by typing camelCase patterns. You have a list of function names (queries) and a search pattern, and you need to determine which functions match the pattern.
A query matches a pattern if you can insert lowercase letters anywhere in the pattern to make it identical to the query. However, you cannot insert uppercase letters - all uppercase letters in the pattern must appear in the exact same order in the query.
For example, if your pattern is "FB", it matches "ForceFeedBack" (insert lowercase letters) but not "FoBa" (missing required characters between F and B).
Goal: Return a boolean array indicating which queries match the pattern.
Input & Output
Visualization
Time & Space Complexity
n queries, each taking O(m) time where m is query length
Only using constant extra space for pointers and variables
Constraints
- 1 β€ queries.length β€ 100
- 1 β€ queries[i].length β€ 100
- 1 β€ pattern.length β€ 100
- queries[i] and pattern consist of English letters
- Pattern and queries contain both uppercase and lowercase letters