• + 0 comments

    Beat Google AI for this one :)

    from itertools import accumulate

    def equalStacks(h1, h2, h3): # Write your code here

    h1a = set(accumulate(h1[::-1]))
    h2a = set(accumulate(h2[::-1]))
    h3a = set(accumulate(h3[::-1]))
    
    return max(h1a.intersection(h2a).intersection(h3a).union({0}))