LeetCodechevron_rightCategorieschevron_rightenumeration
label

enumeration

118 problems
Easy: 26Medium: 58Hard: 34

enumeration is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

#TitleDifficulty
204

Count Primes

Count all prime numbers less than a given integer n using efficient array and math-based enumeration techniques.

Medium
479

Largest Palindrome Product

Find the largest palindromic number from the product of two n-digit integers using math and enumeration efficiently.

Hard
816

Ambiguous Coordinates

Find all valid 2D coordinate possibilities for an ambiguous input string using backtracking and pruning techniques.

Medium
829

Consecutive Numbers Sum

Find the number of ways to express a number as the sum of consecutive positive integers.

Hard
845

Longest Mountain in Array

Find the length of the longest subarray forming a mountain pattern using state transitions and two-pointer logic efficie…

Medium
869

Reordered Power of 2

Determine if a number's digits can be rearranged to form a power of two using counting and hash-based checks.

Medium
906

Super Palindromes

Count all super-palindromes in a given numeric range, where each is a palindrome and square of a palindrome.

Hard
949

Largest Time for Given Digits

Given four digits, determine the latest valid 24-hour time possible using each digit exactly once with backtracking.

Medium
970

Powerful Integers

Find all integers that can be expressed as x^i + y^j up to a given bound using a Hash Table plus Math approach.

Medium
1291

Sequential Digits

Find all integers within a range whose digits form a strictly increasing consecutive sequence using enumeration techniqu…

Medium
1534

Count Good Triplets

Count Good Triplets requires identifying all triplets in an array that satisfy multiple absolute difference constraints …

Easy
1566

Detect Pattern of Length M Repeated K or More Times

Determine if a subarray of length m repeats k or more consecutive times in a given integer array efficiently.

Easy
1601

Maximum Number of Achievable Transfer Requests

Find the maximum number of achievable transfer requests between buildings with constraints on net employee transfers.

Hard
1617

Count Subtrees With Max Distance Between Cities

This problem asks you to count subtrees in a tree structure where the maximum distance between any two cities matches sp…

Hard
1620

Coordinate With Maximum Network Quality

Determine the coordinate with the maximum network quality by summing signal strengths from all reachable towers efficien…

Medium
1625

Lexicographically Smallest String After Applying Operations

Optimize a string through rotations and additions to get the lexicographically smallest possible result using string man…

Medium
1638

Count Substrings That Differ by One Character

Count all substrings from s that differ by exactly one character from some substring in t using precise substring compar…

Medium
1761

Minimum Degree of a Connected Trio in a Graph

Find the minimum degree of a connected trio in a graph using enumeration over nodes and edges.

Hard
1849

Splitting a String Into Descending Consecutive Values

Check if a string of digits can be split into descending consecutive values where the difference between them is 1.

Medium
1863

Sum of All Subset XOR Totals

Compute the sum of all subset XOR totals using a backtracking search with pruning for arrays of small size.

Easy
1925

Count Square Sum Triples

Count Square Sum Triples asks to find the number of integer triples where a² + b² = c² for values between 1 and n.

Easy
1952

Three Divisors

Determine if a given integer has exactly three positive divisors.

Easy
1958

Check if Move is Legal

Determine if a move on an 8x8 board is legal by validating lines in all directions using array and matrix patterns.

Medium
1995

Count Special Quadruplets

Count Special Quadruplets requires scanning arrays and using hash lookups to efficiently find quadruplets matching sum c…

Easy
2014

Longest Subsequence Repeated k Times

Find the longest subsequence repeated k times in a string using backtracking search with pruning.

Hard
2018

Check if Word Can Be Placed In Crossword

Determine if a word fits in a crossword grid using array and matrix checks, accounting for spaces, letters, and blocked …

Medium
2025

Maximum Number of Ways to Partition an Array

Determine the maximum number of ways to split an array into equal sums using at most one element change, leveraging pref…

Hard
2044

Count Number of Maximum Bitwise-OR Subsets

Determine the number of non-empty subsets that achieve the maximum bitwise OR using efficient backtracking and pruning s…

Medium
2048

Next Greater Numerically Balanced Number

Find the smallest numerically balanced number greater than a given integer using backtracking search and pruning.

Medium
2081

Sum of k-Mirror Numbers

This problem requires finding the sum of the n smallest k-mirror numbers by generating palindromes in base-k and base-10…

Hard
2094

Finding 3-Digit Even Numbers

Generate unique 3-digit even numbers from a given array of digits with duplicates.

Easy
2122

Recover the Original Array

Recover the Original Array helps you understand how to reverse-engineer an array from two subsets using array scanning a…

Hard
2151

Maximum Good People Based on Statements

Determine the maximum number of good people in a group given mutual statements, using precise backtracking with pruning.

Hard
2162

Minimum Cost to Set Cooking Time

Calculate the minimum fatigue to set a microwave cooking time using digit moves and pushes efficiently.

Medium
2171

Removing Minimum Number of Magic Beans

Determine the minimum beans to remove so all remaining non-empty bags have equal beans using a greedy approach.

Medium
2212

Maximum Points in an Archery Competition

In the "Maximum Points in an Archery Competition" problem, Bob aims to maximize his score while respecting Alice's arrow…

Medium
2232

Minimize Result by Adding Parentheses to Expression

Enumerate every valid parenthesis placement around the plus sign and choose the expression with the smallest evaluated p…

Medium
2234

Maximum Total Beauty of the Gardens

Determine the maximum total beauty of gardens by strategically planting flowers using binary search over achievable flow…

Hard
2240

Number of Ways to Buy Pens and Pencils

Calculate all distinct ways to spend a fixed total on pens and pencils using a straightforward enumeration strategy.

Medium
2242

Maximum Score of a Node Sequence

Find the maximum score of a valid node sequence in an undirected graph with given node scores and edges.

Hard
2249

Count Lattice Points Inside a Circle

Count the number of lattice points inside at least one circle in a grid, based on given center and radius data.

Medium
2259

Remove Digit From Number to Maximize Result

Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.

Easy
2261

K Divisible Elements Subarrays

Count all distinct subarrays with at most k elements divisible by p using array scanning and hash lookup techniques effi…

Medium
2306

Naming a Company

The "Naming a Company" problem requires determining the number of valid distinct company names from a list of name ideas…

Hard
2309

Greatest English Letter in Upper and Lower Case

Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.

Easy
2310

Sum of Numbers With Units Digit K

Determine the minimum set of positive integers whose units digits match k and sum exactly to num using DP patterns.

Medium
2367

Number of Arithmetic Triplets

Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.

Easy
2397

Maximum Rows Covered by Columns

Select exactly numSelect columns from a binary matrix to maximize rows where all ones are covered efficiently using back…

Medium
2427

Number of Common Factors

The problem asks to find the number of common factors of two positive integers a and b.

Easy
2437

Number of Valid Clock Times

Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.

Easy
2440

Create Components With Same Value

Maximize the number of components in a tree with equal sums by carefully deleting edges using divisor-based logic.

Hard
2443

Sum of Number and Its Reverse

Determine if a non-negative integer can be expressed as the sum of a number and its reverse using enumeration and math r…

Medium
2468

Split Message Based on Limit

Split Message Based on Limit requires dividing a string into parts with length constraints using a calculated suffix pat…

Hard
2552

Count Increasing Quadruplets

Given a permutation of numbers, count the number of increasing quadruplets using dynamic programming.

Hard
2605

Form Smallest Number From Two Digit Arrays

Given two arrays of digits, find the smallest possible number formed by one digit from each array.

Easy
2708

Maximum Strength of a Group

Maximize the strength of a student group by carefully selecting students based on their scores, using dynamic programmin…

Medium
2735

Collecting Chocolates

Calculate the minimum cost to collect all chocolate types using rotations and purchases in an array-based enumeration pa…

Medium
2749

Minimum Operations to Make the Integer Zero

This problem challenges you to compute the minimum operations to reduce an integer to zero using bit manipulation and st…

Medium
2761

Prime Pairs With Target Sum

Find all prime number pairs that sum up to a given integer n using an efficient sieve-based array approach.

Medium
2765

Longest Alternating Subarray

Find the longest alternating subarray in a given array of integers.

Easy
2768

Number of Black Blocks

Calculate the number of black blocks in a grid given a list of black cell coordinates.

Medium
2778

Sum of Squares of Special Elements

Calculate the sum of squares of special elements in a 1-indexed array using index divisibility checks efficiently.

Easy
2800

Shortest String That Contains Three Strings

Find the shortest string containing three given strings using a greedy approach while ensuring it is lexicographically s…

Medium
2843

Count Symmetric Integers

Count Symmetric Integers finds numbers where the sum of the first half of digits equals the sum of the second half withi…

Easy
2844

Minimum Operations to Make a Special Number

Minimize operations to make a number divisible by 25 by deleting digits. Use greedy choice and invariant validation.

Medium
2860

Happy Students

The Happy Students problem asks how many ways a teacher can select a group of students so everyone is happy, based on ce…

Medium
2928

Distribute Candies Among Children I

Given two integers n and limit, find the number of ways to distribute n candies among 3 children, with no child receivin…

Easy
2929

Distribute Candies Among Children II

Determine how to distribute n candies among 3 children without exceeding a limit on individual candies.

Medium
2934

Minimum Operations to Maximize Last Elements in Arrays

Minimize the number of operations needed to maximize the last elements of two arrays with specific swaps.

Medium
2947

Count Beautiful Substrings I

Given a string and a value k, count the number of beautiful substrings where vowels * consonants % k == 0.

Medium
2951

Find the Peaks

Identify all peaks in a mountain array using direct array enumeration and strict neighbor comparisons efficiently.

Easy
2959

Number of Possible Sets of Closing Branches

Calculate all valid sets of branch closures while keeping remaining branches within maxDistance using bitmask and graph …

Hard
2970

Count the Number of Incremovable Subarrays I

Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.

Easy
2975

Maximum Square Area by Removing Fences From a Field

This problem challenges you to calculate the largest square area possible by removing fences from a given rectangular fi…

Medium
3001

Minimum Moves to Capture The Queen

Determine the fewest moves to capture the black queen using only white pieces with careful position analysis.

Medium
3010

Divide an Array Into Subarrays With Minimum Cost I

Divide an array into three contiguous subarrays with minimum cost by leveraging array and sorting principles.

Easy
3020

Find the Maximum Number of Elements in Subset

This problem asks you to find the maximum subset size where each number in the subset follows a specific pattern with ha…

Medium
3025

Find the Number of Ways to Place People I

Calculate how many valid pairs of points can be formed on a 2D plane using array and math enumeration techniques efficie…

Medium
3027

Find the Number of Ways to Place People II

Calculate all valid placements of people on a 2D grid ensuring Alice can fence herself with Bob without enclosing others…

Hard
3044

Most Frequent Prime

Find the most frequent prime over 10 from numbers generated by scanning a 2D matrix in all straight directions efficient…

Medium
3091

Apply Operations to Make Sum of Array Greater Than or Equal to k

Given an array nums, find the minimum number of operations to make the sum of elements greater than or equal to k.

Medium
3114

Latest Time You Can Obtain After Replacing Characters

Given a time string with "?" characters, replace them to form the latest valid 12-hour time.

Easy
3127

Make a Square with the Same Color

Determine if a 3x3 grid can form a 2x2 square of the same color by changing at most one cell efficiently.

Easy
3132

Find the Integer Added to Array II

Given two arrays nums1 and nums2, determine the integer added to nums1 to make it equal to nums2 after removing two elem…

Medium
3139

Minimum Cost to Equalize Array

Compute the minimum cost to make all elements equal using selective operations guided by greedy choices and invariant ch…

Hard
3197

Find the Minimum Area to Cover All Ones II

Find the minimum area to cover all 1's in a 2D binary grid using three non-overlapping rectangles.

Hard
3200

Maximum Height of a Triangle

Find the maximum height of a triangle that can be formed using red and blue balls under given constraints.

Easy
3234

Count the Number of Substrings With Dominant Ones

Count the number of substrings in a binary string with dominant ones, using a sliding window approach with state updates…

Medium
3256

Maximum Value Sum by Placing Three Rooks I

Maximize the value sum by placing three rooks on a chessboard while ensuring they do not attack each other.

Hard
3257

Maximum Value Sum by Placing Three Rooks II

Maximize the sum by placing three non-attacking rooks on a chessboard with dynamic programming.

Hard
3265

Count Almost Equal Pairs I

Count Almost Equal Pairs I involves finding pairs of elements that can be made equal by swapping at most one digit.

Medium
3267

Count Almost Equal Pairs II

Count the number of almost equal integer pairs in an array using array scanning and hash lookup efficiently.

Hard
3272

Find the Count of Good Integers

Count good integers by rearranging digits to form k-palindromic numbers, leveraging hash tables and math techniques.

Hard
3309

Maximum Possible Number by Binary Concatenation

Determine the largest number achievable by reordering three integers and concatenating their binary forms efficiently.

Medium
3345

Smallest Divisible Digit Product I

Find the smallest number greater than or equal to n whose digit product is divisible by t.

Easy
3371

Identify the Largest Outlier in an Array

Identify the largest outlier in an integer array using scanning and hash lookup for efficient detection and validation.

Medium
3380

Maximum Area Rectangle With Point Constraints I

Find the maximum area of a rectangle formed by given points on a plane with unique coordinates.

Medium
3389

Minimum Operations to Make Character Frequencies Equal

This Hard problem asks to transform a string so all character frequencies match using minimal deletions, leveraging dyna…

Hard
3398

Smallest Substring With Identical Characters I

Minimize the length of the longest substring with identical characters after at most numOps changes in a binary string.

Hard
3403

Find the Lexicographically Largest String From the Box I

This problem involves finding the lexicographically largest string from a given word using a two-pointer approach.

Medium
3404

Count Special Subsequences

Count the number of special subsequences in an array of positive integers, focusing on efficient array scanning and hash…

Medium
3411

Maximum Subarray With Equal Products

This problem involves finding the longest subarray where the product equals the LCM multiplied by the GCD, leveraging a …

Easy
3434

Maximum Frequency After Subarray Operation

Determine the maximum frequency of a target value k after applying one subarray addition operation efficiently using arr…

Medium
3435

Frequencies of Shortest Supersequences

Compute all unique shortest common supersequences of given words using graph indegree tracking and topological ordering …

Hard
3440

Reschedule Meetings for Maximum Free Time II

Maximize free time by rescheduling at most one meeting using a greedy choice with invariant validation approach for arra…

Medium
3445

Maximum Difference Between Even and Odd Frequency II

Find the maximum difference between even and odd character frequencies in substrings using sliding window updates effici…

Hard
3470

Permutations IV

Find the k-th alternating permutation of numbers 1 to n, ensuring no adjacent numbers share parity, using array and math…

Hard
3480

Maximize Subarrays After Removing One Conflicting Pair

Maximize the count of subarrays after removing one conflicting pair using array traversal and segment tree logic efficie…

Hard
3483

Unique 3-Digit Even Numbers

Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …

Easy
3499

Maximize Active Section with Trade I

Maximize the number of active sections in a binary string by performing at most one trade operation.

Medium
3503

Longest Palindrome After Substring Concatenation I

Compute the maximum palindrome length by concatenating substrings from two strings using state transition dynamic progra…

Medium
3514

Number of Unique XOR Triplets II

Count all unique XOR results from triplets in an integer array using array traversal and bit manipulation techniques eff…

Medium
3546

Equal Sum Grid Partition I

Determine if an m x n matrix grid can be split into two non-empty sections with equal sums by making a single horizontal…

Medium
3548

Equal Sum Grid Partition II

Determine if a matrix can be partitioned into two sections with an equal sum using a single cut.

Hard
3566

Partition Array into Two Equal Product Subsets

Determine if you can partition an array into two subsets with equal product using recursion and bit manipulation.

Medium
3574

Maximize Subarray GCD Score

Maximize Subarray GCD Score focuses on maximizing a subarray's score by using at most k doubling operations on an array …

Hard
3588

Find Maximum Area of a Triangle

Find the maximum area of a triangle from 2D coordinates with at least one side parallel to the x-axis or y-axis.

Medium
3630

Partition Array for Maximum XOR and AND

Partition the array into three subsequences to maximize XOR and AND operations with a greedy approach.

Hard

Related Patterns

Enumeration LeetCode Problems: 118 Solutions