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.
I implemented the exact same thing but instead of searching for the elements present in the smallest array, i put them in the stacks in the increasing order and popped the top of whichever stack had the biggest number in a loop.
works like a charm and doesn't take too long
Cookie support is required to access HackerRank
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 →
I implemented the exact same thing but instead of searching for the elements present in the smallest array, i put them in the stacks in the increasing order and popped the top of whichever stack had the biggest number in a loop. works like a charm and doesn't take too long