Loading...
Loading...
Section 05 · Stage 2: Master DSA
Complexity, recursion and the patterns behind most coding-round questions.
Read a problem and its limits, trace examples, find edge cases, and move from brute force to a faster idea.
Count steps, read growth rates from constraints, and know what Python operations really cost.
Trace code, choose edge cases, check with assert, and stress test a fast solution against a brute force.
In-place changes, reversal and rotation, merging and partitioning, Kadane, and string building.
Close in from both ends, read and write in place, find triples, and use slow and fast pointers.
Find the best block of neighbouring items in one pass with fixed and variable windows, counters and a deque.
Answer range queries, apply range updates, and solve lookup and subarray problems with sets and dictionaries.
Find items, boundaries, rotation points, peaks and best answers with the classic loop, bisect and search on the answer.
The call stack, the recursion limit, divide and conquer, and memoization with lru_cache.
Build every valid answer one choice at a time and prune: subsets, permutations, N-Queens and grid search.
Bit tricks, subsets with bitmasks, primes, the sieve, GCD and modular arithmetic for coding rounds.
Choose the right pattern from the wording and limits, avoid time-pressure mistakes, and practise on mixed problems.