You are viewing a single comment's thread. Return to all 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}))
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 →
Beat Google AI for this one :)
from itertools import accumulate
def equalStacks(h1, h2, h3): # Write your code here