We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Equal Stacks
- Discussions
Equal Stacks
Equal Stacks
Sort by
recency
|
96 Discussions
|
Please Login in order to post a comment
I do not understand the following explanation for: h1 = [1,2,1,1] h2 = [1,1,2] h3 = [1,1] There are 4, 3, and 2 cylinders in the three stacks, with their heights in the three arrays. Remove the top 2 cylinders from h1 (heights = [1, 2]) and from h2 (heights = [1, 1]) so that the three stacks all are 2 units tall. Return 2 as the answer.
h1 (heights = [1, 2]) has height 3, while h2 (heights = [1, 1]) has height 2, so the answer should be 1
JavaScript Soution:
It's readable
def equalStacks(h1, h2, h3):