## Count of subsets of integers from 1 to N having no adjacent elements

Given an integer N, the task is to count the number of subsets formed from an array of integers from 1 to N which doesn’t… 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
- Count numbers less than N containing digits from the given set : Digit DP
- Number of ways to place two queens on a N*N chess-board
- 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
- Count of distinct XORs formed by rearranging two Binary strings
- Total number of Subsets of size at most K
- Count the numbers with N digits and whose suffix is divisible by K
- Number of ways to color N-K blocks using given operation
- Print the two possible permutations from a given sequence
- Count the number of ways to fill K boxes with N distinct items
- Count of common subarrays in two different permutations of 1 to N
- Find sum of xor of all unordered triplets of the array
- Count of K-size substrings having palindromic permutations
- 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
- Print all permutations of a number N greater than itself

Given an integer N, the task is to count the number of subsets formed from an array of integers from 1 to N which doesn’t… Read More »

Given an integer N, the task is to find the number of permutations of first N positive integers such that prime numbers are at prime… Read More »

Given two values N and K. Find the number of ways to arrange the N distinct items in the boxes such that exactly K (K<N)… Read More »

Given two integers N and R. The task is to calculate the probability of getting exactly r heads in n successive tosses. A fair coin… Read More »

Given an array A, consisting of N non-negative integers, find the sum of xor of all unordered triplets of the array. For unordered triplets, the… Read More »

Given Four integers N, K, P and Q. The task is to calculate the number of ways to arrange N numbers which are in a… Read More »

Given a number N, the task is to count all the rotations of the given number which are divisible by 10. Examples: Input: N =… Read More »

Given an array arr[] of size N consisting of non-negative integers, the task is to find the number of non-empty subsets of the array such… Read More »

Given an array arr containing N elements, find the length of the longest subsequence such that it is a valid permutation of a particular length.… Read More »

Given two numbers N and K. A sequence A1, A2, ….AN of length N can be created by placing numbers from 1 to K at… Read More »

Given an array arr[] of size N, the task is to find the number of permutations in the array that follows the given condition: If… Read More »

Given an array arr containing N positive integers, the task is to check if the given array can be dissociated into two permutations or not… Read More »

Given three numbers N, A, B. The task is to count the number of ways to select things such that there exists no set of… Read More »

Given an undirected connected graph and two vertices A and B, the task is to find the number of pairs of vertices {X, Y} such… Read More »

Given two positive integers N and K, the task is to count the number of positive integers D such that D has N digits and… Read More »