Multiple ChoiceIntermediate 30s
Sliding Window vs Brute Force
Sliding window improves over brute force for fixed-size subarray problems by:
Options
- 1Using a hash table for constant-time key lookups over the window
- 2Sorting the array once before scanning it from left to right
- 3Using recursion instead of an explicit loop over the array
- 4Reusing the sum from the previous window instead of recomputing
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.