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.
this is my code in c++ and it passed every testcase, but it is very simple and very long, it isn't intelligent coding. My idea was to just find the heights of the three stacks and keep removing the top cylinder of the tallest stack (if two stacks were both tallest then I would remove one cylinder from each), is there a more efficient way of coding this?
here is my code:
Equal Stacks
You are viewing a single comment's thread. Return to all comments →
this is my code in c++ and it passed every testcase, but it is very simple and very long, it isn't intelligent coding. My idea was to just find the heights of the three stacks and keep removing the top cylinder of the tallest stack (if two stacks were both tallest then I would remove one cylinder from each), is there a more efficient way of coding this? here is my code: