Given an array arr[] consisting of N integers, the task is to find the remaining array element after subtracting each element from its next adjacent… Read More

# Tag Archives: binomial coefficient

Given an integer N, the task is to count the number of even and odd binomial coefficients up to Nth power. Examples: Input: N =… Read More

Given two integers M and X, the task is to find the number of sequences of length M that can be generated comprising of X… Read More

Given an array, arr[] of size N consisting of elements from the range [1, N], that represents the order, in which the elements are inserted… Read More

Given an integer N, the task is to find the number of distinct bracket sequences that can be formed using 2 * N brackets such… Read More

Given three integers N, M and K, the task is to calculate the sum of products of Binomial Coefficients C(N, i) and C(M, K –… Read More

Given an integer N, the task is to find the Central binomial coefficient. The first few Central binomial coefficients for N = 0, 1, 2,… Read More

Given N blocks out of which K are colored. These K colored blocks are denoted by an array arr[]. The task is to count the… Read More

Given a string str and two integers P and Q. The task is to find the total count of words that can be formed by… 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 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 a complete graph with N vertices, the task is to count the number of ways to remove edges such that the resulting graph has… Read More

A useful application of Pascal’s triangle is the calculation of combinations. The formula to find nCr is n! / r! * (n – r)! which… Read More

Given two positive integers n and k, the task is to count the number of special permutations. A special permutation P is defined as a… Read More