Math formula / math fact [mp]
Micro pattern¶
Description¶
Replace simulation with an identity, counting formula, divisibility fact, or number-theoretic invariant.
Problems¶
Closed-form and combinatorial identities¶
Compute results from sums, combinations, recurrence identities, or structural counts.
- 268. Missing Number (Top Easy)
- 62. Unique Paths (Top Medium)
- 292. Nim Game (Google Prep)
- 279. Perfect Squares (Top Hard)
- 96. Unique Binary Search Trees (Dynamic Programming)
- 790. Domino and Tromino Tiling (Dynamic Programming)
Divisibility and factors¶
Use prime-factor contributions or divisibility by a known power.
- 326. Power of Three (Top Easy)
- 172. Factorial Trailing Zeroes (Top Medium)
Arithmetic decomposition¶
Break arithmetic into positional, bitwise, or repeated-remainder operations.
- 29. Divide Two Integers (Top Medium)
- 50. Pow(x, n) (Top Medium)
- 166. Fraction to Recurring Decimal (Top Medium)
Scheduling formula¶
Derive a schedule bound from peak frequency and available gaps.
- 621. Task Scheduler (Top Medium)
GCD normalization¶
Reduce coordinate differences to a primitive integer direction.
- 149. Max Points on a Line (Top Hard)