leaps.ggTRACK YOUR MASTERY →
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.

General Math

253 problems →
#PROBLEMDIFFELOIMPPATTERNS
1Rotate ImageEasy129478
Matrix Traversal (Diagonal, Valid Sudoku, etc)
2Missing NumberEasy108672
General Bit Manipulation · Frequency Counting / Hash Map Lookup
3Pow(x, n)Easy130872
General Bit Manipulation
4Transpose MatrixEasy125963
Matrix Traversal (Diagonal, Valid Sudoku, etc)
5Add BinaryEasy117662
General Bit Manipulation
+ 248 more General Math problems →

Modular Arithmetic

18 problems →
#PROBLEMDIFFELOIMPPATTERNS
1Count Good NumbersMedium167552
General Math
2Number of Ways to Divide a Long CorridorHard191552
Combinatorics · Linear Recurrence DP
3Find the Divisibility Array of a StringMedium154145
Prefix Sums
4Fancy SequenceHard247642
Prefix Sums · Frequency Counting / Hash Map Lookup
5Smallest All-Ones MultipleMedium159341
Frequency Counting / Hash Map Lookup
+ 13 more Modular Arithmetic problems →

GCD / LCM

29 problems →
#PROBLEMDIFFELOIMPPATTERNS
1Greatest Common Divisor of StringsEasy139872
Frequency Counting / Hash Map Lookup
2Insert Greatest Common Divisors in Linked ListEasy127962
Merge Linked Lists
3X of a Kind in a Deck of CardsEasy137148
Frequency Counting / Hash Map Lookup
4Find the Maximum Factor Score of ArrayMedium151947
Prefix Sums
5Minimum Number of Operations to Make All Array Elements Equal to 1Hard192947
General Greedy (Greedy is main insight)
+ 24 more GCD / LCM problems →

Primes / Sieve of Eratosthenes

19 problems →
#PROBLEMDIFFELOIMPPATTERNS
1Count PrimesEasy125348
2Minimize Array Sum Using Divisible ReplacementsMedium165243
General Greedy (Greedy is main insight)
3Prime Pairs With Target SumMedium150542
Complement Search (Two Sum Pattern)
4Closest Prime Numbers in RangeMedium165040
Sorting + Comparison
5Split the Array to Make Coprime ProductsHard215938
Frequency Counting / Hash Map Lookup · Reachability / Frontier Greedy
+ 14 more Primes / Sieve of Eratosthenes problems →

Combinatorics

42 problems →
#PROBLEMDIFFELOIMPPATTERNS
1Vowels of All SubstringsMedium166355
Prefix Sums
2Count All Valid Pickup and Delivery OptionsMedium172353
Linear Recurrence DP · Modular Arithmetic
3Ways to Split Array Into Good SubarraysMedium159848
Frequency Counting / Hash Map Lookup · Modular Arithmetic
4Number of Ways to Reorder Array to Get Same BSTHard228848
BST Operations (Insert, Delete, Validate) · Linear Recurrence DP
5Count the Number of Arrays with K Matching Adjacent ElementsHard231048
Modular Arithmetic
+ 37 more Combinatorics problems →
EVERY PATTERN
Arrays & HashingTwo PointersStackBinary SearchSliding WindowLinked ListTreesTriesBacktrackingHeap / Priority QueueGraphsCore DPIntervalsGreedyAdvanced GraphsAdvanced DPBit ManipulationMath & Geometry
// your mastery
Bronze tier crystalSilver tier crystalGold tier crystalPlatinum tier crystalDiamond tier crystal
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 →