# Category Archives: Combinatorial

## Product of all Subsequences of size K except the minimum and maximum Elements

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 »

## Count arrays of length K whose product of elements is same as that of given array

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 »

## Count different numbers possible using all the digits their frequency times

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 »

## Number of subsequences with zero sum

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 »

## 3-digit Osiris number

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 »

## Dudeney Numbers

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 »

## Check whether N is a Dihedral Prime Number or not

Given an integer N, the task is to check if N is a Dihedral prime number or not. A Dihedral prime is a prime number… Read More »

## Number of triangles possible with given lengths of sticks which are powers of 2

Given an array of N integers where arr[i] denotes the number of sticks of length 2i. The task is to find the number of triangles… Read More »

## Count pairs of non-overlapping palindromic sub-strings of the given string

Given a string S. The task is to count the non-overlapping pairs of palindromic sub-strings S1 and S2 such that the strings should be S1[L1…R1]… Read More »

## Number of ways of choosing K equal substrings of any length for every query

Given a string str and Q queries. Each query consists of an integer K. The task is to find the number of ways of choosing… Read More »

## Count number of binary strings of length N having only 0’s and 1’s

Given an integer N, the task is to count the number of binary strings of length N having only 0’s and 1’s. Note: Since the… Read More »

## XOR of all the elements in the given range [L, R]

Given a range [L, R], the task is to find the XOR of all the integers in the given range i.e. (L) ^ (L +… Read More »

## Number of ways to go from one point to another in a grid

Given the NxN grid of horizontal and vertical roads. The task is to find out the number of ways that the person can go from… Read More »

## Find the good permutation of first N natural numbers

Given an integer N, the task is to print a good permutation of first N natural numbers. Let’s denote the ith element of the permutation… Read More »

## Find the numbers of strings that can be formed after processing Q queries

Given a number N(1<=N<=2000)., The task is to find the number strings of size N that can be obtained after using characters from 'a' to… Read More »