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 Anagram Lenses.
Scanning the entire history after every event cannot keep up with live players.
How you win
- 1Recognize when Frequency signature window matches the clues
- 2Keep this true after every move: the window frequency table describes exactly pattern.length characters
- 3Reach the result within O(n)
Rules and pressure
- Target cost: O(n)
- State rule: the window frequency table describes exactly pattern.length characters
Lesson 1 of 3
Build the pattern frequency inventory once. Then slide an equally wide lens and compare counts.
Your call · Do abc and cba match?