PROBLEMS/MATH & GEOMETRY
Math & Geometry LeetCode Problems
361 hand-tagged Math & Geometry problems across 5 interview patterns (General Math, Modular Arithmetic, GCD / LCM, Primes / Sieve of Eratosthenes, Combinatorics), ranked by importance (how often each pattern shows up in real coding interviews). Work top-down within each pattern.
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Rotate Image | Easy | 1294 | 78 | Matrix Traversal (Diagonal, Valid Sudoku, etc) |
| 2 | Missing Number | Easy | 1086 | 72 | General Bit Manipulation · Frequency Counting / Hash Map Lookup |
| 3 | Pow(x, n) | Easy | 1308 | 72 | General Bit Manipulation |
| 4 | Transpose Matrix | Easy | 1259 | 63 | Matrix Traversal (Diagonal, Valid Sudoku, etc) |
| 5 | Add Binary | Easy | 1176 | 62 | General Bit Manipulation |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Count Good Numbers | Medium | 1675 | 52 | General Math |
| 2 | Number of Ways to Divide a Long Corridor | Hard | 1915 | 52 | Combinatorics · Linear Recurrence DP |
| 3 | Find the Divisibility Array of a String | Medium | 1541 | 45 | Prefix Sums |
| 4 | Fancy Sequence | Hard | 2476 | 42 | Prefix Sums · Frequency Counting / Hash Map Lookup |
| 5 | Smallest All-Ones Multiple | Medium | 1593 | 41 | Frequency Counting / Hash Map Lookup |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Greatest Common Divisor of Strings | Easy | 1398 | 72 | Frequency Counting / Hash Map Lookup |
| 2 | Insert Greatest Common Divisors in Linked List | Easy | 1279 | 62 | Merge Linked Lists |
| 3 | X of a Kind in a Deck of Cards | Easy | 1371 | 48 | Frequency Counting / Hash Map Lookup |
| 4 | Find the Maximum Factor Score of Array | Medium | 1519 | 47 | Prefix Sums |
| 5 | Minimum Number of Operations to Make All Array Elements Equal to 1 | Hard | 1929 | 47 | General Greedy (Greedy is main insight) |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Count Primes | Easy | 1253 | 48 | |
| 2 | Minimize Array Sum Using Divisible Replacements | Medium | 1652 | 43 | General Greedy (Greedy is main insight) |
| 3 | Prime Pairs With Target Sum | Medium | 1505 | 42 | Complement Search (Two Sum Pattern) |
| 4 | Closest Prime Numbers in Range | Medium | 1650 | 40 | Sorting + Comparison |
| 5 | Split the Array to Make Coprime Products | Hard | 2159 | 38 | Frequency Counting / Hash Map Lookup · Reachability / Frontier Greedy |
| # | PROBLEM | DIFF | ELO | IMP | PATTERNS |
|---|---|---|---|---|---|
| 1 | Vowels of All Substrings | Medium | 1663 | 55 | Prefix Sums |
| 2 | Count All Valid Pickup and Delivery Options | Medium | 1723 | 53 | Linear Recurrence DP · Modular Arithmetic |
| 3 | Ways to Split Array Into Good Subarrays | Medium | 1598 | 48 | Frequency Counting / Hash Map Lookup · Modular Arithmetic |
| 4 | Number of Ways to Reorder Array to Get Same BST | Hard | 2288 | 48 | BST Operations (Insert, Delete, Validate) · Linear Recurrence DP |
| 5 | Count the Number of Arrays with K Matching Adjacent Elements | Hard | 2310 | 48 | Modular Arithmetic |
EVERY PATTERN
// your mastery





What's your Math & Geometry tier?
leaps.gg syncs your LeetCode history and scores your mastery of every pattern, then recommends the exact problems to do next with spaced repetition. Free to start.
GET MY MASTERY MAP →