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 one is really easy. If you have n-pairs of socks, that means that worst case you pick one sock from each pair. From there any sock you choose has to be a match.
So by the pidgeon hole principle we get the answer to just be n+1
Surprisingly basic to be honest
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Draws
You are viewing a single comment's thread. Return to all comments →
This one is really easy. If you have n-pairs of socks, that means that worst case you pick one sock from each pair. From there any sock you choose has to be a match.
So by the pidgeon hole principle we get the answer to just be n+1
Surprisingly basic to be honest