## Number of moves required to guess a permutation.

Given an integer N and there is a hidden permutation (of numbers from 1 to N, each occurring exactly once) that you need to guess.… Read More »

## Total number of subsets in which the product of the elements is even

Given an array arr[] of integer elements, the task is to find the total number of sub-sets of arr[] in which product of the elements… Read More »

## Print all numbers less than N with at-most 2 unique digits

Given a number N(less than 10^9). The task is to print all the numbers less than N which are having a maximum of 2 unique… Read More »

## Generating Lyndon words of length n

Given an integer n and an array of characters S, the task is to generate Lyndon words of length n having characters from S. A… Read More »

## Ways to form n/2 pairs such that difference of pairs is minimum

Given an array arr of N integers, the task is to split the elements of the array into N/2 pairs (each pair having 2 elements)… Read More »

## Different possible marks for n questions and negative marking

Given the number of questions as , and marks for the correct answer as and marks for the incorrect answer. One can either attempt to… Read More »

## N digit numbers divisible by 5 formed from the M digits

Given M unique digits and a number N. The task is to find the number of N-digit numbers which can be formed from the given… Read More »

## Number of triangles formed from a set of points on three lines

Given three integers m, n and k that store the number of points on lines l1, l2 and l3 respectively that do not intersect. The… Read More »

## Number of ways to arrange a word such that all vowels occur together

Given a word containing vowels and consonants. The task is to find that in how many different ways word can be arranged so that the… Read More »

## Ways of selecting men and women from a group to make a team

Given four integers n, w, m and k where, m is the total number of men. w is the total number of women. n is… Read More »

## Maximum points of intersection n lines

You are given n straight lines. You have to find maximum number of point of intersection with these n lines. Examples: Input : n =… Read More »

## Minimum numbers needed to express every integer below N as a sum

We have an integer N. We need to express N as a sum of K integers such that by adding some(or all) of these integers… Read More »

## Count number of ordered pairs with Even and Odd Sums

Given an array of n positive numbers, the task is to count number of ordered pairs with even and odd sum. Examples: Input: arr[] =… Read More »

## Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two

Given an array of N elements. The task is to count unordered pairs (i, j) in the array such that the product of a[i] and… Read More »

## Count numbers whose difference with N is equal to XOR with N

Given a number N. The task is to count the all possible values of x such that nx is equal to (N-x), where denotes bitwise… Read More »