DSA
Generate all combinations of well-formed parentheses using backtracking. Optimal — Time O(4ⁿ/√n), Space O(n).
Simulate row-by-row traversal with direction flip. Optimal — Time O(n), Space O(n).
Covers: Brute Force O(n²), Sliding Window O(n). Classic premium sliding-window problem using a character frequency map.
5 approaches incl. Brute Force, Better, Optimized Approach: SLiding…, and more. Optimal — Time O(n), Space O(1).
Sliding Window approach. Optimal — Time O(n), Space O(1).
Strings. Time O(n), Space O(n).
Strings. Time O(n), Space O(1).
Strings problem — solution with code and analysis.
Covers: Two Parallel Stacks, Single Stack of Pairs. Optimal — Time O(n), Space O(n).
Covers: Brute Force: Converting to S…, Better. Optimal — Time O(n), Space O(1).
Covers: Brute Force, Optimal. Optimal — Time O(N + M), Space O(1).
Iterative run-length encoding. Time O(n · 2^n), Space O(2^n).
Covers: Brute Force, One Hash Map, Two Hashmaps. Optimal — Time O(n), Space O(1).
5 approaches incl. Horizontal Scanning, Vertical Scanning, Binary Search, and more. Optimal — Time O(s log m), Space O(1).
Covers: Roman to Int, Int to Roman. Optimal — Time O(N), Space O(1).
Covers: Brute Force, Better, Dynamic Programming. Optimal — Time O(n^2), Space O(n^2).
Covers: Stack, Two pointer (in-place reversal). Optimal — Time O(n), Space O(1).
Sliding Window - Fixed approach. Optimal — Time O(n), Space O(1).
Using Trie approach. Optimal — Time O(n^2), Space O(n^2).
Trie. Time O(nL), Space O(nL).
Covers: Brute Force: Sorting, Hash Map, For fixed characters. Optimal — Time O(n), Space O(1).
Covers: Brute Force: generate all su…, Expansion on center, DP. Optimal — Time O(n<sup>2</sup>), Space O(n<sup>2</sup>).
Covers: Brute Force, Sliding Window. Optimal — Time O(n), Space O(1).
Dynamic Programming. Time O(m*n), Space O(m*n).
4 approaches incl. Brute Force, Recursive, Memoized DP, and more. Optimal — Time O(m*n), Space O(n).
Covers: Brute Force: Recursion + Bac…, DP Solution: Tabulation, DP Solution: Tabulation - Sp…. Optimal — Time O(n), Space O(1).
Tabulation approach. Optimal — Time O(m*n), Space O(m*n).
Covers: Sorting + Hashing, character counts Based key. Optimal — Time O(n * k), Space O(n * k).