Combinatorics Problems
Master combinatorics problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 32 problems in this category.
Total Problems: 32
Easy: 2
Medium: 9
Hard: 21
Showing 32 of 32 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Combinatorics LeetCode Problems List
- 62. Unique Paths - Medium - CombinatoricsThere is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-rig... Topics: Math, Dynamic Programming, Combinatorics
- 2605. Count Anagrams - Hard - CombinatoricsYou are given a string s containing one or more words. Every consecutive pair of words is separated by a single space ' '. A string t is an anagram of... Topics: Hash Table, Math, String, Combinatorics, Counting
- 1461. Count All Valid Pickup and Delivery Options - Hard - CombinatoricsGiven n orders, each order consists of a pickup and a delivery service. Count all valid pickup/delivery possible sequences such that delivery(i) is al... Topics: Math, Dynamic Programming, Combinatorics
- 1993. Sum of All Subset XOR Totals - Easy - CombinatoricsThe 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
- 1941. Minimum Number of Operations to Make String Sorted - Hard - CombinatoricsYou are given a string s (0-indexed). You are asked to perform the following operation on s until you get a sorted string: Find the larges... Topics: Math, String, Combinatorics
- 3937. Number of Integers With Popcount-Depth Equal to K I - Hard - CombinatoricsYou are given two integers n and k. For any positive integer x, define the following sequence: p0 = x pi+1 = popcount(pi) for all i >= 0, where popcou... Topics: Math, Dynamic Programming, Combinatorics
- 489. Kth Smallest Instructions - Hard - CombinatoricsBob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. You are going to help Bob by prov... Topics: Array, Math, Dynamic Programming, Combinatorics
- 3414. Find Number of Ways to Reach the K-th Stair - Hard - CombinatoricsYou are given a non-negative integer k. There exists a staircase with an infinite number of stairs, with the lowest stair numbered 0. Alice has an int... Topics: Math, Dynamic Programming, Bit Manipulation, Memoization, Combinatorics
- 3388. Right Triangles - Medium - CombinatoricsYou are given a 2D boolean matrix grid. A collection of 3 elements of grid is a right triangle if one of its elements is in the same row with another ... Topics: Array, Hash Table, Math, Combinatorics, Counting
- 1725. Number of Sets of K Non-Overlapping Line Segments - Medium - CombinatoricsGiven n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exactly k non-overlapping line seg... Topics: Math, Dynamic Programming, Combinatorics
- 2324. Find Triangular Sum of an Array - Medium - CombinatoricsYou are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive). The triangular sum of nums is the value of the onl... Topics: Array, Math, Simulation, Combinatorics
- 1307. Ugly Number III - Medium - CombinatoricsAn ugly number is a positive integer that is divisible by a, b, or c. Given four integers n, a, b, and c, return the nth ugly number.... Topics: Math, Binary Search, Combinatorics, Number Theory
- 3199. Distribute Candies Among Children I - Easy - CombinatoricsYou 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
- 3212. Count the Number of Good Partitions - Hard - CombinatoricsYou are given a 0-indexed array nums consisting of positive integers. A partition of an array into one or more contiguous subarrays is called good if ... Topics: Array, Hash Table, Math, Combinatorics
- 3682. Count the Number of Arrays with K Matching Adjacent Elements - Hard - CombinatoricsYou are given three integers n, m, k. A good array arr of size n is defined as follows: Each element in arr is in the inclusive range [1, m]. Exactly ... Topics: Math, Combinatorics
- 3813. Smallest Palindromic Rearrangement II - Hard - CombinatoricsYou are given a palindromic string s and an integer k. Return the k-th lexicographically smallest palindromic permutation of s. If there are fewer tha... Topics: Hash Table, Math, String, Combinatorics, Counting
- 2415. Count the Number of Ideal Arrays - Hard - CombinatoricsYou are given two integers n and maxValue, which are used to describe an ideal array. A 0-indexed integer array arr of length n is considered ideal if... Topics: Math, Dynamic Programming, Combinatorics, Number Theory
- 3864. Count the Number of Computer Unlocking Permutations - Medium - CombinatoricsYou are given an array complexity of length n. There are n locked computers in a room with labels from 0 to n - 1, each with its own unique password. ... Topics: Array, Math, Brainteaser, Combinatorics
- 1692. Number of Ways to Reorder Array to Get Same BST - Hard - CombinatoricsGiven an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the eleme... Topics: Array, Math, Divide and Conquer, Dynamic Programming, Tree, Union Find, Binary Search Tree, Memoization, Combinatorics, Binary Tree
- 3535. Find the Count of Monotonic Pairs I - Hard - CombinatoricsYou are given an array of positive integers nums of length n. We call a pair of non-negative integer arrays (arr1, arr2) monotonic if: The lengths of ... Topics: Array, Math, Dynamic Programming, Combinatorics, Prefix Sum
- 3637. Count Number of Balanced Permutations - Hard - CombinatoricsYou are given a string num. A string of digits is called balanced if the sum of the digits at even indices is equal to the sum of the digits at odd in... Topics: Math, String, Dynamic Programming, Combinatorics
- 3700. Subsequences with a Unique Middle Mode I - Hard - CombinatoricsGiven an integer array nums, find the number of subsequences of size 5 of nums with a unique middle mode. Since the answer may be very large, return i... Topics: Array, Hash Table, Math, Combinatorics
- 3774. Check If Digits Are Equal in String After Operations II - Hard - CombinatoricsYou are given a string s consisting of digits. Perform the following operation repeatedly until the string has exactly two digits: For each pair of co... Topics: Math, String, Combinatorics, Number Theory
- 1996. Number of Ways to Rearrange Sticks With K Sticks Visible - Hard - CombinatoricsThere are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactly k sticks are visible from t... Topics: Math, Dynamic Programming, Combinatorics
- 2187. Vowels of All Substrings - Medium - CombinatoricsGiven a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word. A substring is a contiguous (non... Topics: Math, String, Dynamic Programming, Combinatorics
- 3739. Manhattan Distances of All Arrangements of Pieces - Hard - CombinatoricsYou are given three integers m, n, and k. There is a rectangular grid of size m × n containing k identical pieces. Return the sum of Manhattan distanc... Topics: Math, Combinatorics
- 458. Poor Pigs - Hard - CombinatoricsThere are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poo... Topics: Math, Dynamic Programming, Combinatorics
- 2696. The Number of Beautiful Subsets - Medium - CombinatoricsYou are given an array nums of positive integers and a positive integer k. A subset of nums is beautiful if it does not contain two integers with an a... Topics: Array, Hash Table, Math, Dynamic Programming, Backtracking, Sorting, Combinatorics
- 1577. Probability of a Two Boxes Having The Same Number of Distinct Balls - Hard - CombinatoricsGiven 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i. All the ball... Topics: Array, Math, Dynamic Programming, Backtracking, Combinatorics, Probability and Statistics
- 3200. Number of Strings Which Can Be Rearranged to Contain Substring - Medium - CombinatoricsYou are given an integer n. A string s is called good if it contains only lowercase English characters and it is possible to rearrange the characters ... Topics: Math, Dynamic Programming, Combinatorics
- 3783. Permutations IV - Hard - CombinatoricsGiven 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
- 3631. Count K-Reducible Numbers Less Than N - Hard - CombinatoricsYou are given a binary string s representing a number n in its binary form. You are also given an integer k. An integer x is called k-reducible if per... Topics: Math, String, Dynamic Programming, Combinatorics
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
- 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
- Divide and Conquer LeetCode Problems