Skip to main content

Checkpoint: fix the window sum

Challenge on lesson: Checkpoint: the window boundary

CHALLENGE
Difficulty: advanced+25 XP

The method should return the **largest sum of any k consecutive elements** (k >= 1, array longer than k). It returns wrong values whenever the best window touches the array's end. Find and fix the bug.

Back to lesson: Checkpoint: the window boundary