โฑ Step 2: The 60-second routine (tap through it on each problem)
๐ Step 3: Pattern cards (scan the clue tags)
โฑ What is Big O?
Time complexity answers: "If the input gets 10ร bigger, how much more work is there?" Space complexity answers: "How much extra memory do I need?" (the input itself doesn't count). We drop constants and keep only the fastest-growing term, so 3n + 5 becomes O(n).
๐ Drag to grow n
n = 10
Each bar shows how many steps it takes, on a log scale so they all fit. At n = 1000, O(nยฒ) is already 1,000,000 steps.
๐ How to spot it from code shape
๐พ How to spot space
๐ The patterns at a glance
๐ค What the letters mean n is the size of the input, for example how many numbers are in the list. k is a second number the problem gives you. In "find the top k" or "a window of size k", k = 3 means you only keep 3 things around. V (vertices) is the number of points or cells, and E (edges) is the number of connections between them. In a 3ร4 grid, V = 12 cells and each cell has up to 4 neighbours, so it's O(rows ร cols). states (in DP) is how many different dp[i] values you fill in, like the 7 boxes in the Climbing Stairs demo.
๐ฃ How to say it in the interview
"This runs in O(n) time because each element is visited once, and O(n) space for the dict. If memory mattered, I could sort first and use two pointers, which is O(n log n) time and O(1) space."