Comments

I see now. That helped alot, thanks.

I'm kind of a noob here, so how can I do that using prefix sum ?

In the problem integral array how can i check for the existence of x in constant time ?