You are viewing a single comment's thread. Return to all comments →
def weightedUniformStrings(s, queries): U = set() ord_a = ord('a') ss = 0 pivot = '.' for c in s: if c != pivot: pivot = c ss = 0 val = ord(c) - ord_a + 1 U.add(val) ss += val U.add(ss) return [('Yes' if q in U 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 →