You are viewing a single comment's thread. Return to all comments →
Python
def weightedUniformStrings(s, queries): st = set() uniform = [max(re.findall(f'{i}+', s)) for i in set(s)] [st.add((ord(j[0]) - 96) * n) for j in uniform for n in range(1, len(j)+1)] return ['Yes' if q in st else 'No' for q in queries]
Seems like cookies are disabled on this browser, please enable them to open this website
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
Python