## 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 »

## Number of ways in which the substring in range [L, R] can be formed using characters out of the range

Given a string S and a range [L, R]. The task is to find the number of ways in which the sub-string in the range… Read More »

## Perform K of Q queries to maximize the sum of the array elements

Given an array arr[] of N integers and an integer K. Also given are Q queries which have two numbers L and R. For every… Read More »

## Number of ways of scoring R runs in B balls with at most W wickets

Given three integers R, B and W which denote the number of runs, balls and wickets. One can score 0, 1, 2, 3, 6 or… Read More »

## Maximum sum from three arrays such that picking elements consecutively from same is not allowed

Given three arrays A[], B[] and C[] of N integers. We can choose N elements from these array such that for every index i only… Read More »

## Find a pair from the given array with maximum nCr value

Given an array arr[] of n positive integers. The task is to find elements arr[i] and arr[j] from the array such that arr[i]Carr[j] is maximum… Read More »

## Find the number of good permutations

Given two integers N and K. The task is to find the number of good permutations of first N natural numbers. A permutation is called… Read More »