Enumeration Problems
Master enumeration problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 68 problems in this category.
Total Problems: 68
Easy: 18
Medium: 32
Hard: 18
Showing 50 of 68 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Enumeration LeetCode Problems List
- 204. Count Primes - Medium - EnumerationGiven an integer n, return the number of prime numbers that are strictly less than n.... Topics: Array, Math, Enumeration, Number Theory
- 856. Consecutive Numbers Sum - Hard - EnumerationGiven an integer n, return the number of ways you can write n as the sum of consecutive positive integers.... Topics: Math, Enumeration
- 2202. Sum of k-Mirror Numbers - Hard - EnumerationA k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 as well as in base-k. For examp... Topics: Math, Enumeration
- 3221. Find the Peaks - Easy - EnumerationYou are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array. Return an array that consists of indices of peaks ... Topics: Array, Enumeration
- 1656. Count Good Triplets - Easy - EnumerationGiven an array of integers arr, and three integers a, b and c. You need to find the number of good triplets. A triplet (arr[i], arr[j], arr[k]) is goo... Topics: Array, Enumeration
- 1993. Sum of All Subset XOR Totals - Easy - EnumerationThe XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For example, the XOR total of the array [2,5,... Topics: Array, Math, Backtracking, Bit Manipulation, Combinatorics, Enumeration
- 3104. Happy Students - Medium - EnumerationYou are given a 0-indexed integer array nums of length n where n is the total number of students in the class. The class teacher tries to select a gro... Topics: Array, Sorting, Enumeration
- 2170. Count Number of Maximum Bitwise-OR Subsets - Medium - EnumerationGiven an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the ma... Topics: Array, Backtracking, Bit Manipulation, Enumeration
- 2870. Longest Alternating Subarray - Easy - EnumerationYou are given a 0-indexed integer array nums. A subarray s of length m is called alternating if: m is greater than 1. s1 = s0 + 1. The 0-indexed subar... Topics: Array, Enumeration
- 875. Longest Mountain in Array - Medium - EnumerationYou may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (0-indexed) with 0 < i < arr.length - 1... Topics: Array, Two Pointers, Dynamic Programming, Enumeration
- 2328. Minimize Result by Adding Parentheses to Expression - Medium - EnumerationYou are given a 0-indexed string expression of the form "<num1>+<num2>" where <num1> and <num2> represent positive integers. Add a pair of parentheses... Topics: String, Enumeration
- 3741. Reschedule Meetings for Maximum Free Time II - Medium - EnumerationYou are given an integer eventTime denoting the duration of an event. You are also given two integer arrays startTime and endTime, each of length n. T... Topics: Array, Greedy, Enumeration
- 2140. Longest Subsequence Repeated k Times - Hard - EnumerationYou are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeated k times in string s. A subsequence is ... Topics: String, Backtracking, Greedy, Counting, Enumeration
- 1363. Greatest English Letter in Upper and Lower Case - Easy - EnumerationGiven a string of English letters s, return the greatest English letter which occurs as both a lowercase and uppercase letter in s. The returned lette... Topics: Hash Table, String, Enumeration
- 2531. Create Components With Same Value - Hard - EnumerationThere is an undirected tree with n nodes labeled from 0 to n - 1. You are given a 0-indexed integer array nums of length n where nums[i] represents th... Topics: Array, Math, Tree, Depth-First Search, Enumeration
- 2332. Count Lattice Points Inside a Circle - Medium - EnumerationGiven a 2D integer array circles where circles[i] = [xi, yi, ri] represents the center (xi, yi) and radius ri of the ith circle drawn on a grid, retur... Topics: Array, Hash Table, Math, Geometry, Enumeration
- 1212. Sequential Digits - Medium - EnumerationAn integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers... Topics: Enumeration
- 2810. Collecting Chocolates - Medium - EnumerationYou are given a 0-indexed integer array nums of size n representing the cost of collecting different chocolates. The cost of collecting the chocolate ... Topics: Array, Enumeration
- 2563. Split Message Based on Limit - Hard - EnumerationYou are given a string, message, and a positive integer, limit. You must split message into one or more parts based on limit. Each resulting part shou... Topics: String, Binary Search, Enumeration
- 2083. Three Divisors - Easy - EnumerationGiven an integer n, return true if n has exactly three positive divisors. Otherwise, return false. An integer m is a divisor of n if there exists an i... Topics: Math, Enumeration, Number Theory
- 3398. Make a Square with the Same Color - Easy - EnumerationYou are given a 2D matrix grid of size 3 x 3 consisting only of characters 'B' and 'W'. Character 'W' represents the white color, and character 'B' re... Topics: Array, Matrix, Enumeration
- 3399. Find the Integer Added to Array II - Medium - EnumerationYou are given two integer arrays nums1 and nums2. From nums1 two elements have been removed, and all other elements have been increased (or decreased ... Topics: Array, Two Pointers, Sorting, Enumeration
- 3882. Partition Array for Maximum XOR and AND - Hard - EnumerationYou are given an integer array nums. Partition the array into three (possibly empty) subsequences A, B, and C such that every element of nums belongs ... Topics: Array, Math, Greedy, Enumeration
- 3594. Identify the Largest Outlier in an Array - Medium - EnumerationYou are given an integer array nums. This array contains n elements, where exactly n - 2 elements are special numbers. One of the remaining two elemen... Topics: Array, Hash Table, Counting, Enumeration
- 2877. Shortest String That Contains Three Strings - Medium - EnumerationGiven three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings. If there are ... Topics: String, Greedy, Enumeration
- 3270. Minimum Moves to Capture The Queen - Medium - EnumerationThere is a 1-indexed 8 x 8 chessboard containing 3 pieces. You are given 6 integers a, b, c, d, e, and f where: (a, b) denotes the position of the whi... Topics: Math, Enumeration
- 2146. Check if Word Can Be Placed In Crossword - Medium - EnumerationYou are given an m x n matrix board, representing the current state of a crossword puzzle. The crossword contains lowercase English letters (from solv... Topics: Array, Matrix, Enumeration
- 2889. Number of Black Blocks - Medium - EnumerationYou are given two integers m and n representing the dimensions of a 0-indexed m x n grid. You are also given a 0-indexed 2D integer matrix coordinates... Topics: Array, Hash Table, Enumeration
- 2037. Count Square Sum Triples - Easy - EnumerationA square triple (a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2. Given an integer n, return the number of square triples such that... Topics: Math, Enumeration
- 3868. Find Maximum Area of a Triangle - Medium - EnumerationYou are given a 2D array coords of size n x 2, representing the coordinates of n points in an infinite Cartesian plane. Find twice the maximum area of... Topics: Array, Hash Table, Math, Greedy, Geometry, Enumeration
- 479. Largest Palindrome Product - Hard - EnumerationGiven an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be ve... Topics: Math, Enumeration
- 900. Reordered Power of 2 - Medium - EnumerationYou are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero. Return true if ... Topics: Hash Table, Math, Sorting, Counting, Enumeration
- 3690. Smallest Substring With Identical Characters I - Hard - EnumerationYou are given a binary string s of length n and an integer numOps. You are allowed to perform the following operation on s at most numOps times: Selec... Topics: Array, Binary Search, Enumeration
- 2215. Finding 3-Digit Even Numbers - Easy - EnumerationYou are given an integer array digits, where each element is a digit. The array may contain duplicates. You need to find all the unique integers that ... Topics: Array, Hash Table, Sorting, Enumeration
- 942. Super Palindromes - Hard - EnumerationLet's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome. Given two positive integers left ... Topics: Math, String, Enumeration
- 3850. Equal Sum Grid Partition II - Hard - EnumerationYou are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut... Topics: Array, Hash Table, Matrix, Enumeration, Prefix Sum
- 3469. Maximum Height of a Triangle - Easy - EnumerationYou are given two integers red and blue representing the count of red and blue colored balls. You have to arrange these balls to form a triangle such ... Topics: Array, Enumeration
- 2754. Maximum Strength of a Group - Medium - EnumerationYou are given a 0-indexed integer array nums representing the score of students in an exam. The teacher would like to form one non-empty group of stud... Topics: Array, Dynamic Programming, Backtracking, Greedy, Bit Manipulation, Sorting, Enumeration
- 3250. Maximum Square Area by Removing Fences From a Field - Medium - EnumerationThere is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays ... Topics: Array, Hash Table, Enumeration
- 2442. Number of Arithmetic Triplets - Easy - EnumerationYou are given a 0-indexed, strictly increasing integer array nums and a positive integer diff. A triplet (i, j, k) is an arithmetic triplet if the fol... Topics: Array, Hash Table, Two Pointers, Enumeration
- 2390. Naming a Company - Hard - EnumerationYou are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company... Topics: Array, Hash Table, String, Bit Manipulation, Enumeration
- 3702. Maximum Subarray With Equal Products - Easy - EnumerationYou are given an array of positive integers nums. An array arr is called product equivalent if prod(arr) == lcm(arr) * gcd(arr), where: prod(arr) is t... Topics: Array, Math, Sliding Window, Enumeration, Number Theory
- 2337. Remove Digit From Number to Maximize Result - Easy - EnumerationYou are given a string number representing a positive integer and a character digit. Return the resulting string after removing exactly one occurrence... Topics: String, Greedy, Enumeration
- 3199. Distribute Candies Among Children I - Easy - EnumerationYou are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more... Topics: Math, Combinatorics, Enumeration
- 3683. Find the Lexicographically Largest String From the Box I - Medium - EnumerationYou are given a string word, and an integer numFriends. Alice is organizing a game for her numFriends friends. There are multiple rounds in the game, ... Topics: Two Pointers, String, Enumeration
- 3713. Frequencies of Shortest Supersequences - Hard - EnumerationYou are given an array of strings words. Find all shortest common supersequences (SCS) of words that are not permutations of each other. A shortest co... Topics: Array, String, Bit Manipulation, Graph, Topological Sort, Enumeration
- 3761. Maximum Difference Between Even and Odd Frequency II - Hard - EnumerationYou are given a string s and an integer k. Your task is to find the maximum difference between the frequency of two characters, freq[a] - freq[b], in ... Topics: String, Sliding Window, Enumeration, Prefix Sum
- 3534. Count Almost Equal Pairs I - Medium - EnumerationYou are given an array nums consisting of positive integers. We call two integers x and y in this problem almost equal if both integers can become equ... Topics: Array, Hash Table, Sorting, Counting, Enumeration
- 3190. Minimum Operations to Maximize Last Elements in Arrays - Medium - EnumerationYou are given two 0-indexed integer arrays, nums1 and nums2, both having length n. You are allowed to perform a series of operations (possibly none). ... Topics: Array, Enumeration
- 2351. Number of Ways to Buy Pens and Pencils - Medium - EnumerationYou are given an integer total indicating the amount of money you have. You are also given two integers cost1 and cost2 indicating the price of a pen ... Topics: Math, Enumeration
- 2290. Removing Minimum Number of Magic Beans - Medium - EnumerationYou are given an array of positive integers beans, where each integer represents the number of magic beans found in a particular magic bag. Remove any... Topics: Array, Greedy, Sorting, Enumeration, Prefix Sum
- 1723. Maximum Number of Achievable Transfer Requests - Hard - EnumerationWe have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the bui... Topics: Array, Backtracking, Bit Manipulation, Enumeration
- 2174. Next Greater Numerically Balanced Number - Medium - EnumerationAn integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digit in x. Given an integer n, ret... Topics: Hash Table, Math, Backtracking, Counting, Enumeration
- 1689. Detect Pattern of Length M Repeated K or More Times - Easy - EnumerationGiven an array of positive integers arr, find a pattern of length m that is repeated k or more times. A pattern is a subarray (consecutive sub-sequenc... Topics: Array, Enumeration
- 2330. Maximum Total Beauty of the Gardens - Hard - EnumerationAlice is a caretaker of n gardens and she wants to plant flowers to maximize the total beauty of all her gardens. You are given a 0-indexed integer ar... Topics: Array, Two Pointers, Binary Search, Greedy, Sorting, Enumeration, Prefix Sum
- 986. Largest Time for Given Digits - Medium - EnumerationGiven an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once. 24-hour times are formatted as "HH:MM", w... Topics: Array, String, Backtracking, Enumeration
- 3793. Longest Palindrome After Substring Concatenation I - Medium - EnumerationYou are given two strings, s and t. You can create a new string by selecting a substring from s (possibly empty) and a substring from t (possibly empt... Topics: Two Pointers, String, Dynamic Programming, Enumeration
- 2668. Form Smallest Number From Two Digit Arrays - Easy - EnumerationGiven two arrays of unique digits nums1 and nums2, return the smallest number that contains at least one digit from each array.... Topics: Array, Hash Table, Enumeration
- 3843. Partition Array into Two Equal Product Subsets - Medium - EnumerationYou are given an integer array nums containing distinct positive integers and an integer target. Determine if you can partition nums into two non-empt... Topics: Array, Bit Manipulation, Recursion, Enumeration
- 1740. Count Subtrees With Max Distance Between Cities - Hard - EnumerationThere are n cities numbered from 1 to n. You are given an array edges of size n-1, where edges[i] = [ui, vi] represents a bidirectional edge between c... Topics: Dynamic Programming, Bit Manipulation, Tree, Enumeration, Bitmask
- 2266. Minimum Cost to Set Cooking Time - Medium - EnumerationA generic microwave supports cooking times for: at least 1 second. at most 99 minutes and 99 seconds. To set the cooking time, you push at most four d... Topics: Math, Enumeration
- 3328. Apply Operations to Make Sum of Array Greater Than or Equal to k - Medium - EnumerationYou are given a positive integer k. Initially, you have an array nums = [1]. You can perform any of the following operations on the array any number o... Topics: Math, Greedy, Enumeration
- 3046. Minimum Operations to Make a Special Number - Medium - EnumerationYou are given a 0-indexed string num representing a non-negative integer. In one operation, you can pick any digit of num and delete it. Note that if ... Topics: Math, String, Greedy, Enumeration
- 2507. Number of Common Factors - Easy - EnumerationGiven two positive integers a and b, return the number of common factors of a and b. An integer x is a common factor of a and b if x divides both a an... Topics: Math, Enumeration, Number Theory
- 3789. Maximize Subarrays After Removing One Conflicting Pair - Hard - EnumerationYou are given an integer n which represents an array nums containing the numbers from 1 to n in order. Additionally, you are given a 2D array conflict... Topics: Array, Segment Tree, Enumeration, Prefix Sum
- 2998. Count Symmetric Integers - Easy - EnumerationYou are given two positive integers low and high. An integer x consisting of 2 * n digits is symmetric if the sum of the first n digits of x is equal ... Topics: Math, Enumeration
- 2873. Prime Pairs With Target Sum - Medium - EnumerationYou are given an integer n. We say that two integers x and y form a prime number pair if: 1 <= x <= y <= n x + y == n x and y are prime numbers Return... Topics: Array, Math, Enumeration, Number Theory
- 3783. Permutations IV - Hard - EnumerationGiven two integers, n and k, an alternating permutation is a permutation of the first n positive integers such that no two adjacent elements are both ... Topics: Array, Math, Combinatorics, Enumeration
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems