leetcode1023】的更多相关文章

A query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.) Given a list of queries, and a pattern, return an an…
class Solution(object): def getGroup(self,que): group = list() temp = '' for i in range(len(que)): cur = que[i] if cur.isupper(): group.append(temp) temp = '' temp += cur if len(group)>0 and len(group[0])==0: group.pop(0) group.append(temp) return gr…