Hello Codeforces,
My sister implemented the solution for 279B — Books here:
And so amazing !!!! This solution is accepted. I've tried but cannot create the test case to prove this solution is wrong. Can you help me ? Or can you prove that this solution is correct
Thank you a lot for your help.
That solution is correct. It's a basic implementation of two-pointers.
At any time, if sum <= m, then [l, i] is a valid answer. From [l, i — 1], we should increase the length by one. Otherwise, we keep the current length at the same amount, from [l, i — 1] to [l + 1, i]