Skip to content
playdsa
Preferences

Make yourself comfortable.

Saved on this browser. Your device’s reduced-motion preference is always respected.

Theme
Advanced settings

The Sunlit Window

Learn
Play
Prove
Problem context and objectives
Mission briefing

Live-ops game engineer · A multiplayer arena is reporting bursts of lag

Find the smallest or strongest contiguous time window: The Sunlit Window.

Scanning the entire history after every event cannot keep up with live players.

How you win

  1. 1Recognize when Fixed sliding window matches the clues
  2. 2Keep this true after every move: the running sum equals exactly the current k values
  3. 3Reach the result within O(n)

Rules and pressure

  • Target cost: O(n)
  • State rule: the running sum equals exactly the current k values

New words in this mission

Open a term for a plain-language explanation.
invariant+

A statement that must remain true after every meaningful step. It is the safety rule connecting the visual state to correct code.

Lesson 1 of 3

Build the first fixed-window sum once. It is also the initial best, even when every value is negative.

Your call · What is the first sum for [2,1,5]?

Help shape PlayDSA

Something confusing, broken, or missing? Leave a quick note without leaving your lesson.

Please leave out passwords, payment details and other private information.

Page included: /

Sign in to save feedback here, or send it with your email app. Your draft stays here while you sign in.

Open email instead