Hacker News new | past | comments | ask | show | jobs | submit login

This seems similar to selecting a single random line from a file in a single pass:

http://41j.com/blog/2015/02/select-random-line-file-single-p...

Which is a question I've had come up in interviews. It's a neat trick.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: