## Iterative approach to print all combinations of an Array

Given an array arr[] of size N, the task is to generate and print all possible combinations of R elements in array. Examples: Input: arr[]… Read More »

- Number of Subsequences with Even and Odd Sum | Set 2
- Count the number of subsequences of length k having equal LCM and HCF
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Count permutation such that sequence is non decreasing
- Number of words that can be made using exactly P consonants and Q vowels from the given string
- Ways to choose balls such that at least one ball is chosen
- Number of K length subsequences with minimum sum
- Count of distinct graphs that can be formed with N vertices
- Total ways of selecting a group of X men from N men with or without including a particular man
- Number of triangles that can be formed

Given an array arr[] of size N, the task is to generate and print all possible combinations of R elements in array. Examples: Input: arr[]… Read More »

Given an English word of length at most 20 characters. Calculate the number of ways to arrange the word such that no vowels occur together.… Read More »

Given a tree with N nodes and a number K. Paint every node of the tree in one of the K available colors. Count and… Read More »

Given three integers N, R and P where P is prime, the task is to find whether NCR is divisible by P or not. Examples:… Read More »

Given an N * N matrix arr[][] consisting of non-negative integers, the task is to find the number of ways to reach arr[N – 1][N… Read More »

Given a string, generate all permutations of it that do not contain ‘B’ after ‘A’, i.e., the string should not contain “AB” as a substring.… Read More »

Given three integers N, E and O. The task is to find an array of size N such that the number of sub-arrays of sum… Read More »

Given an array arr[] of size N, the task is to count the number of ways we can select a subset from the given array… Read More »

Given two integers K and N, the task is to count the number of ways to arrange K different objects taking N objects at a… Read More »

Given an array A[] containing N elements and an integer K. The task is to calculate the product of all elements of subsequences of size… Read More »

Given an integer array arr[] of length N and an integer K, the task is to count the number of possible arrays of length K… Read More »

Given an array arr[] which contains the frequency of the digits (0-9), the task is to find the count of numbers possible using each digit… Read More »

Given an array arr[] of N integers. The task is to count the number of sub-sequences whose sum is 0. Examples: Input: arr[] = {-1,… Read More »

Given a 3-digit number N, the task is to find if N is an Osiris number or not. Osiris numbers are the numbers that are… Read More »

Given an integer n, the task is to check if n is a Dudeney number or not. A Dudeney number is a positive integer that… Read More »