Enumeration LeetCode Problems: All 80, With Python Solutions
Every problem in this library that LeetCode tags Enumeration — 80 in total, 75 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 80 problems
- 20 Easy
- 40 Medium
- 20 Hard
Enumeration problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (20)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 1534 | Count Good Triplets | Easy | Array, Enumeration |
| 1566 | Detect Pattern of Length M Repeated K or More Times | Easy | Array, Enumeration |
| 1863 | Sum of All Subset XOR Totals | Easy | Bit Manipulation, Array, Math +3 |
| 1925 | Count Square Sum Triples | Easy | Math, Enumeration |
| 1952 | Three Divisors | Easy | Math, Enumeration, Number Theory |
| 1995 | Count Special Quadruplets | Easy | Array, Hash Table, Enumeration |
| 2094 | Finding 3-Digit Even Numbers | Easy | Recursion, Array, Hash Table +2 |
| 2259 | Remove Digit From Number to Maximize Result | Easy | Greedy, String, Enumeration |
| 2309 | Greatest English Letter in Upper and Lower Case | Easy | Hash Table, String, Enumeration |
| 2367 | Number of Arithmetic Triplets | Easy | Array, Hash Table, Two Pointers +1 |
| 2427 | Number of Common Factors | Easy | Math, Enumeration, Number Theory |
| 2437 | Number of Valid Clock Times | Easy | String, Enumeration |
| 2605 | Form Smallest Number From Two Digit Arrays | Easy | Array, Hash Table, Enumeration |
| 2765 | Longest Alternating Subarray | Easy | Array, Enumeration |
| 2778 | Sum of Squares of Special Elements | Easy | Array, Enumeration |
| 2843 | Count Symmetric Integers | Easy | Math, Enumeration |
| 2928 | Distribute Candies Among Children I | Easy | Math, Combinatorics, Enumeration |
| 2951 | Find the Peaks | Easy | Array, Enumeration |
| 2970 | Count the Number of Incremovable Subarrays I | Easy | Array, Two Pointers, Binary Search +1 |
| 800 | Similar RGB ColorPremium | Easy | Math, String, Enumeration |
Medium (40)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 204 | Count Primes | Medium | Array, Math, Enumeration +1 |
| 816 | Ambiguous Coordinates | Medium | String, Backtracking, Enumeration |
| 845 | Longest Mountain in Array | Medium | Array, Two Pointers, Dynamic Programming +1 |
| 869 | Reordered Power of 2 | Medium | Hash Table, Math, Counting +2 |
| 949 | Largest Time for Given Digits | Medium | Array, String, Backtracking +1 |
| 970 | Powerful Integers | Medium | Hash Table, Math, Enumeration |
| 1291 | Sequential Digits | Medium | Enumeration |
| 1620 | Coordinate With Maximum Network Quality | Medium | Array, Enumeration |
| 1625 | Lexicographically Smallest String After Applying Operations | Medium | Depth-First Search, Breadth-First Search, String +1 |
| 1638 | Count Substrings That Differ by One Character | Medium | Hash Table, String, Dynamic Programming +1 |
| 1849 | Splitting a String Into Descending Consecutive Values | Medium | String, Backtracking, Enumeration |
| 1958 | Check if Move is Legal | Medium | Array, Enumeration, Matrix |
| 2018 | Check if Word Can Be Placed In Crossword | Medium | Array, Enumeration, Matrix |
| 2044 | Count Number of Maximum Bitwise-OR Subsets | Medium | Bit Manipulation, Array, Backtracking +1 |
| 2048 | Next Greater Numerically Balanced Number | Medium | Hash Table, Math, Backtracking +2 |
| 2162 | Minimum Cost to Set Cooking Time | Medium | Math, Enumeration |
| 2171 | Removing Minimum Number of Magic Beans | Medium | Greedy, Array, Enumeration +2 |
| 2212 | Maximum Points in an Archery Competition | Medium | Bit Manipulation, Array, Backtracking +1 |
| 2232 | Minimize Result by Adding Parentheses to Expression | Medium | String, Enumeration |
| 2240 | Number of Ways to Buy Pens and Pencils | Medium | Math, Enumeration |
| 2249 | Count Lattice Points Inside a Circle | Medium | Geometry, Array, Hash Table +2 |
| 2261 | K Divisible Elements Subarrays | Medium | Trie, Array, Hash Table +3 |
| 2310 | Sum of Numbers With Units Digit K | Medium | Greedy, Math, Dynamic Programming +1 |
| 2397 | Maximum Rows Covered by Columns | Medium | Bit Manipulation, Array, Backtracking +2 |
| 2443 | Sum of Number and Its Reverse | Medium | Math, Enumeration |
| 2708 | Maximum Strength of a Group | Medium | Greedy, Bit Manipulation, Array +4 |
| 2735 | Collecting Chocolates | Medium | Array, Enumeration |
| 2749 | Minimum Operations to Make the Integer Zero | Medium | Bit Manipulation, Brainteaser, Enumeration |
| 2761 | Prime Pairs With Target Sum | Medium | Array, Math, Enumeration +1 |
| 2768 | Number of Black Blocks | Medium | Array, Hash Table, Enumeration |
| 2800 | Shortest String That Contains Three Strings | Medium | Greedy, String, Enumeration |
| 2844 | Minimum Operations to Make a Special Number | Medium | Greedy, Math, String +1 |
| 2860 | Happy Students | Medium | Array, Enumeration, Sorting |
| 2929 | Distribute Candies Among Children II | Medium | Math, Combinatorics, Enumeration |
| 2934 | Minimum Operations to Maximize Last Elements in Arrays | Medium | Array, Enumeration |
| 2947 | Count Beautiful Substrings I | Medium | Hash Table, Math, String +3 |
| 2975 | Maximum Square Area by Removing Fences From a Field | Medium | Array, Hash Table, Enumeration |
| 681 | Next Closest TimePremium | Medium | Hash Table, String, Backtracking +1 |
| 1999 | Smallest Greater Multiple Made of Two DigitsPremium | Medium | Math, Enumeration |
| 2417 | Closest Fair IntegerPremium | Medium | Math, Enumeration |
Hard (20)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 479 | Largest Palindrome Product | Hard | Math, Enumeration |
| 829 | Consecutive Numbers Sum | Hard | Math, Enumeration |
| 906 | Super Palindromes | Hard | Math, String, Enumeration |
| 1601 | Maximum Number of Achievable Transfer Requests | Hard | Bit Manipulation, Array, Backtracking +1 |
| 1617 | Count Subtrees With Max Distance Between Cities | Hard | Bit Manipulation, Tree, Dynamic Programming +2 |
| 1761 | Minimum Degree of a Connected Trio in a Graph | Hard | Graph, Enumeration |
| 2014 | Longest Subsequence Repeated k Times | Hard | Greedy, String, Backtracking +2 |
| 2025 | Maximum Number of Ways to Partition an Array | Hard | Array, Hash Table, Counting +2 |
| 2081 | Sum of k-Mirror Numbers | Hard | Math, Enumeration |
| 2122 | Recover the Original Array | Hard | Array, Hash Table, Two Pointers +2 |
| 2151 | Maximum Good People Based on Statements | Hard | Bit Manipulation, Array, Backtracking +1 |
| 2234 | Maximum Total Beauty of the Gardens | Hard | Greedy, Array, Two Pointers +4 |
| 2242 | Maximum Score of a Node Sequence | Hard | Graph, Array, Enumeration +1 |
| 2306 | Naming a Company | Hard | Bit Manipulation, Array, Hash Table +2 |
| 2440 | Create Components With Same Value | Hard | Tree, Depth-First Search, Array +2 |
| 2468 | Split Message Based on Limit | Hard | String, Binary Search, Enumeration |
| 2552 | Count Increasing Quadruplets | Hard | Binary Indexed Tree, Array, Dynamic Programming +2 |
| 2763 | Sum of Imbalance Numbers of All Subarrays | Hard | Array, Hash Table, Enumeration |
| 2959 | Number of Possible Sets of Closing Branches | Hard | Bit Manipulation, Graph, Enumeration +2 |
| 1956 | Minimum Time For K Virus Variants to SpreadPremium | Hard | Geometry, Array, Math +2 |
Keep exploring
All LeetCode topicsEvery tag with a page of its own, with the number of problems behind each.LeetCode patternsThe techniques themselves, with a Python template and complexity for each.Curated study listsBlind 75, NeetCode 150 and three more, grouped by pattern.Easy problemsStart here when the data structure is new rather than the problem.
Other topics
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116
When the Enumeration problem arrives live
Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.