Patterns
Learn how to choose the right approach and understand what the problem is asking.
Core Array & Subarray Patterns
Sliding Window
Uses a moving window to work with contiguous parts of an array or string.
Explore Pattern
Two Pointers
Uses two indices to scan or compare elements in an array or string efficiently.
Explore Pattern
Prefix Sum
Pre-computes cumulative sums to find the sum of any subarray in constant time.
Explore Pattern
Hashing
Uses a hash map or set to store and retrieve values in average O(1) time.
Explore Pattern