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
- 1Recognize when Fixed sliding window matches the clues
- 2Keep this true after every move: the running sum equals exactly the current k values
- 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]?