Hacker News new | ask | show | jobs
by swah 5558 days ago
Given the input and output, why isn't a linear search a proper solution?
1 comments

Because linear is O(n) and binary is O(log(n))?
Oh, sorry - didn't notice that was a requirement.
I don't think it was an explicit requirement, it just would be very wasteful to do a linear search on a sorted list.