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

## Number of permutations of a string in which all the occurrences of a given character occurs together

Given a string ‘s’ and a character ‘c’, the task is to find the number of permutations of the string in which all the occurrences… Read More »

## Calculate Stirling numbers which represents the number of ways to arrange r objects around n different circles

S(r, n), represents the number of ways that we can arrange r objects around indistinguishable circles of length n, and every circle n must have… Read More »

## Ways of dividing a group into two halves such that two elements are in different groups

Given 2n girls and randomly divided into two subgroups each containing n girls. The task is to count the number of ways in which groups… Read More »

## Seating arrangement of n boys and girls alternatively around a round table

There are n boys and n girls are to be seated around a round table, in a circle. The task is to find number of… Read More »

## Count ordered pairs of positive numbers such that their sum is S and XOR is K

Given a sum and a number . The task is to count all possible ordered pairs (a, b) of positive numbers such that the two… Read More »

## Count Numbers with N digits which consists of odd number of 0’s

We are given a number N. The task is to find the count of numbers which have N digits and odd number of zeroes. Note:… Read More »

## Program to calculate the value of nCr Efficiently

Given two numbers n, r ( n>=r ). The task is to find the value of C(n, r) for big value of n. Examples: Input:… Read More »

## Number of unique permutations starting with 1 of a Binary String

Given a binary string composed of 0’s and 1’s. The task is to find the number of unique permutation of the string which starts with… Read More »

## Find sum of product of number in given series

Given two numbers N and T where, and . The task is to find the value of . Since sum can be large, output it… Read More »