Equal Stacks

  • + 0 comments
    from itertools import accumulate as a
    
    def equalStacks(h1, h2, h3):
        return max(set(a(h1[::-1])) & set(a(h2[::-1])) & set(a(h3[::-1])) | {0})