TRT
Sign in

Advanced · Module 21

Pattern-Wise Problem Solving & Disambiguation Playbook

Recognize, disambiguate, and implement all 28 core problem-solving patterns from constraint clues, invariants, and brute-force bottlenecks.

Start the modulePro4 lessons · about 72 minutes

Knowing how an algorithm works is only half the battle; in interviews and contests, the hardest step is looking at a brand-new problem statement and recognizing which pattern applies and why look-alike patterns fail. This module provides the complete Pattern-Wise Playbook and decision matrix across all 28 patterns.

  1. 1Linear Patterns: Two Pointers vs. Sliding Window vs. Prefix Sum + Hash MapPro — members onlyDisambiguate contiguous subarray and pair problems instantly: when non-negative elements unlock a O(1)-space Sliding Window, when negative numbers require Prefix Sum + Hash Map, and when range updates call for a Difference Array.18 min
  2. 2Order & Stack Patterns: Binary Search on Answer, Monotonic Stack/Queue, and Sweep-LinePro — members onlyRecognize 'minimize the maximum' clues for Binary Search on Answer, find Next Greater Elements and Sliding Window Maximums in O(N) with Monotonic Stacks/Deques, and count overlapping intervals with Sweep-Line events.18 min
  3. 3Combinatorial Search Patterns: Subsets, Permutations, Pruning, and Meet-in-the-MiddlePro — members onlyMaster the unified choose-explore-unchoose backtracking templates for Subsets, Combinations, and Permutations with duplicate pruning, and halve exponential exponents from O(2^40) to O(2^20) with Meet-in-the-Middle.18 min
  4. 4DP State Patterns: 1D/2D/Knapsack vs. Interval DP, Tree DP, and Bitmask DPPro — members onlyDesign minimal DP states and transition order across all 8 canonical DP families: 1D/2D Grid, Subsequence, 0/1 & Unbounded Knapsack, Interval DP (len 1..N), Tree DP, and Bitmask DP.18 min