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 guys are probably all throwing each n into a hashset, before doing unionWith, right? This (in my opinion) really pedantic case specifically wants you to figure out that you can ignore the astronauts who are alone in their country in your algorithm, only deal with astronauts that have more than one astronaut from the same country,(the array) then add the loners together at the end.(n - astronauts used in array) I think it's pretty nitpicky to specifically call something like that out.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Journey to the Moon
You are viewing a single comment's thread. Return to all comments →
You guys are probably all throwing each n into a hashset, before doing unionWith, right? This (in my opinion) really pedantic case specifically wants you to figure out that you can ignore the astronauts who are alone in their country in your algorithm, only deal with astronauts that have more than one astronaut from the same country,(the array) then add the loners together at the end.(n - astronauts used in array) I think it's pretty nitpicky to specifically call something like that out.