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

- Print all the permutation of length L using the elements of an array | Iterative
- 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 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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »