You are viewing a single comment's thread. Return to all comments →
Python3 set intersect:
def equalStacks(h1, h2, h3): s1 = set(accumulate(reversed(h1), lambda s, n: s + n)) s2 = set(accumulate(reversed(h2), lambda s, n: s + n)) s3 = set(accumulate(reversed(h3), lambda s, n: s + n)) return max(s1 & s2 & s3, default=0)
Seems like cookies are disabled on this browser, please enable them to open this website
Equal Stacks
You are viewing a single comment's thread. Return to all comments →
Python3 set intersect: