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.
You are wrong, for this chalenge you only need to traverse the list once. You will keep two lists:
1. list of name found for the second position
2. list of names found for the currently min value.
In case you find a another min value, the second position list of names becomes the min value list of names.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
You are wrong, for this chalenge you only need to traverse the list once. You will keep two lists: 1. list of name found for the second position 2. list of names found for the currently min value. In case you find a another min value, the second position list of names becomes the min value list of names.