## Number of ways to paint K cells in 3 x N grid such that no P continuous columns are left unpainted

Given three integers N, P and K, the task is to find the number of ways of painting K cells of 3 x N grid… Read More »

- Sum of GCD of all possible sequences
- Longest permutation subsequence in a given array
- Number of ways to write N as a sum of K non-negative integers
- Probability of getting K heads in N coin tosses
- Total number of BSTs using array elements
- Sum of all subsequences of length K
- Count ways to reach the Nth stair using multiple 1 or 2 steps and a single step 3
- Count rotations which are divisible by 10
- Number of pairs such that path between pairs has the two vertices A and B
- Number of subsets with same AND, OR and XOR values in an Array
- Count numbers in a range with digit sum divisible by K having first and last digit different
- Count number of triangles possible for the given sides range
- Number of ways to place two queens on a N*N chess-board
- Count numbers less than N containing digits from the given set : Digit DP
- Count of Binary strings of length N having atmost M consecutive 1s or 0s alternatively exactly K times
- Find the Number of Permutations that satisfy the given condition in an array
- Count numbers with exactly K non-zero digits and distinct odd digit sum
- Find the K-th Permutation Sequence of first N natural numbers
- Count of distinct XORs formed by rearranging two Binary strings
- Total number of Subsets of size at most K
- Number of ways to color N-K blocks using given operation
- Count the numbers with N digits and whose suffix is divisible by K
- Count the number of ways to fill K boxes with N distinct items
- Find sum of xor of all unordered triplets of the array
- Count of K-size substrings having palindromic permutations
- Print the two possible permutations from a given sequence
- Count of common subarrays in two different permutations of 1 to N
- Product of all sorted subsets of size K using elements whose index divide K completely
- Maximum number of strings that can be formed with given zeros and ones
- Sort decreasing permutation of N using triple swaps

Given three integers N, P and K, the task is to find the number of ways of painting K cells of 3 x N grid… Read More »

Given an integer N denoting the number of dices, the task is to find the probability of every possible value that can be obtained by… Read More »

Given an integer N, the task is to count every number i from 1 to N (both inclusive) such that i is a binary representation… Read More »

Given an array A[] consisting of decreasing permutation of N numbers, the task is to sort the array using triple swaps. If it is not… Read More »

Given an array arr[] of line segments on the x-axis and an integer K, the task is to calculate the number of ways to choose… Read More »

Given an integer K and an array arr[], the task is to find the number of subsequences from the given array such that each subsequence… Read More »

Given a string str, the task is to find the number of strings that start and end with the same character after a rotation at… Read More »

Given an array arr[] and an integer K, the task is to find number of non empty subsequence of length K from the given array… Read More »

Burnside’s Lemma is also sometimes known as orbit counting theorem. It is one of the results of group theory. It is used to count distinct… Read More »

Given two integers N and K, find the Kth permutation sequence of numbers from 1 to N without using STL function. Note: Assume that the… Read More »

Given three integers, N, K and M. The task is to find out the number of binary strings of length N which always starts with… Read More »

Given a number N, the task is to find the sum of the product of elements of all the possible subsets formed by only divisors… Read More »

Given an integer array arr[] of N distinct elements and a positive integer K ( K <= N ). The task is to calculate the… Read More »

Given an integer N denoting a N * N chess-board, the task is to count the number of ways to place two queens on the… Read More »

Given an integer X, denoting the number of factors of a positive integer N can have. the task is to find the maximum number of… Read More »