Hacker News new | ask | show | jobs
by williamdclt 354 days ago
You could make the problem harder with "you are given a stream of n - 1 integers". N could then be any number, unbound by available memory.

That makes the problem harder which makes it more interesting, a lot of the solutions wouldn't work anymore (this isn't necessarily a good interview question though)

1 comments

Even with the original formulation, the array doesn't have to fit in available memory. mmap exists.
You are given a magnetic tape containing a list of n - 1 integers… :-)