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.
"The shortest stick length is 1 , so cut that length from the longer two and discard the pieces of length"
So: first cut, then discard pieces same length as the shortest.
But the solution is expected to be: first discard sticks of shortest length, and then cut the bigger sticks.
Moreover the other requirement is that result list contains the size of the list after each iteration, but the solution is expected to include the size of the list at the beginning of any iteration.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cut the sticks
You are viewing a single comment's thread. Return to all comments →
The requirement is presented as:
"The shortest stick length is 1 , so cut that length from the longer two and discard the pieces of length"
So: first cut, then discard pieces same length as the shortest. But the solution is expected to be: first discard sticks of shortest length, and then cut the bigger sticks. Moreover the other requirement is that result list contains the size of the list after each iteration, but the solution is expected to include the size of the list at the beginning of any iteration.