# Leetcode 1023. Camelcase Matching

## 2. Solution

• Version 1
```class Solution:
def camelMatch(self, queries: List[str], pattern: str) -> List[bool]:
result = []
for i in range(len(queries)):
res = self.match(queries[i], pattern)
result.append(res)

return result

def match(self, query, pattern):
i = 0
j = 0
while i < len(query) and j < len(pattern):
if query[i] == pattern[j]:
i += 1
j += 1
else:
if query[i].isupper():
return False
else:
i += 1

if j == len(pattern) and (i == len(query) or query[i:].islower()):
return True
return False```

## Reference

1. https://leetcode.com/problems/camelcase-matching/

0 条评论

• ### Leetcode 【553、609、856、1003、1023】

这道题是给一个数组，各个数字连除，通过加括号，使得除操作的结果最大。刚开始想着是遍历所有加括号的方式，然后求出最大结果。但是，发现加括号的规律很麻烦。

• ### Leetcode Regular Expression Matching

Given an input string (s) and a pattern (p), implement regular expression matchi...

• ### leetcode 10 Regular Expression Matching（简单正则表达式匹配）

最近代码写的少了，而leetcode一直想做一个python，c/c++解题报告的专题，c/c++一直是我非常喜欢的，c语言编程练习的重要性体现在linux内核...

• ### Leetcode 10 Regular Expression Matching

Implement regular expression matching with support for '.' and '*'. '.' Matches...

• ### 【LeetCode-010】Regular Expression Matching

Given an input string (s) and a pattern (p), implement regular expression matchi...