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

Yeah, you are right, I should have mentioned that.



But there's an easy fix: don't pick numbers from the given sequence, instead use binary search on [0,n]. Then you're guaranteed only log n iterations.


Hi, I was using pure functional programming style, so list only.




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

Search: