Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
theseoafs
on April 29, 2014
|
parent
|
context
|
favorite
| on:
How to pair socks from a pile efficiently?
This would be O(n), since the time it takes to pair your socks is still proportional to the number of socks you have
yen223
on April 29, 2014
[–]
The idea is that I don't need to pair my socks. I can just take any random 2 socks from the heap whenever I'm going out, since they are all the same. Hence, O(1).
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: