You are viewing a single comment's thread. Return to all comments →
def weightedUniformStrings(s, queries): out = [] variants = set() prev = None for value in s: code_point = ord(value) - 96 if value != prev: temp = code_point else: temp += code_point prev = value variants.add(temp) [out.append('Yes' if x in variants else 'No') for x in queries] return out
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 →