DSA
Check if a root-to-leaf path sums to a target. Optimal — Time O(n), Space O(h).
Generate all combinations of well-formed parentheses using backtracking. Optimal — Time O(4ⁿ/√n), Space O(n).
Miscellaneous problem — solution with code and analysis.
Covers: Brute Force, Optimized Safe Check. Optimal — Time O(9^(number of empty cells), Space O(m*n).
Trie. Time O(m×k×4^L), Space O(L).
5 approaches incl. Recursion (Include/Exclude), Recursion (Include/Exclude),…, Backtracking (start-index st…, and more. Optimal — Time O(n), Space O(1).
4 approaches incl. Backtracking with a `used` a…, Backtracking via in-place sw…, Iterative (insert into every…, and more. Optimal — Time O(n), Space O(1).
Sliding Window - Fixed approach. Optimal — Time O(n), Space O(1).
Recursion & Backtracking. Time O(4^(m*n), Space O(m*n).
Backtracking approach. Optimal — Time O(m^n), Space O(n).
Covers: Rules, Approach - Backtracking, Improved - hashsets. Optimal — Time O(N!), Space O(N<sup>2</sup>).
Recursion & Backtracking. Time O(n! * n), Space O(n! * n).
Recursion & Backtracking. Time O(n * 2^n), Space O(n).
Recursion & Backtracking. Time O(2<sup>n</sup>), Space O(n).
Covers: Brute Force - Recursion, When to Use Tabulation. Optimal — Time O(2<sup>T</sup>), Space O(T).
Recursion & Backtracking. Time O(2^n), Space O(n * 2^n).
Covers: Brute Force, Optimal. Optimal — Time O(n), Space O(1).
Tabulation approach. Optimal — Time O(n*k), Space O(k).
Covers: Recursive, Memoized. Optimal — Time O(n*k), Space O(n*k).
DFS - Backtracking approach. Optimal — Time O(mn * 4^L), Space O(1).
Covers: Naive, Better, So the intuition is:. Optimal — Time O(n log n + K log K), Space O(K).
Hashing & Sorting problem — solution with code and analysis.
Covers: Recursion, Memoized, Tabulation. Optimal — Time O(n*k), Space O(n*k ).