Remix.run Logo
williamdclt a day 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)

Arnavion a day ago | parent [-]

Even with the original formulation, the array doesn't have to fit in available memory. mmap exists.

cluckindan a day ago | parent [-]

You are given a magnetic tape containing a list of n - 1 integers… :-)