Hi,
The variant of problem 14.11 asks to solve the problem in constant space. But that’s what the main problem’s solution does.
Hi,
The variant of problem 14.11 asks to solve the problem in constant space. But that’s what the main problem’s solution does.
you are correct, and i have removed the variant. thanks for pointing that out.
i think our original solution used sorted inputs and a prefix sum array which we did away with, giving the O(1) space solution implied by the variant.
cheers,
adnan