You are viewing a single comment's thread. Return to all comments →
python3
def weightedUniformStrings(s, queries): d = {c:ord(c)-96 for c in set(s)} for i in range(len(queries)): ans = "No" for c, w in d.items(): if queries[i]%w==0 and c*(queries[i]//w) in s: ans = "Yes" break queries[i] = ans return 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 →
python3