## Composite numbers with digit sum 1

Given a range [L, R], the task is to find all the numbers from the range which are composite as well as the eventual sum… Read More »

## Determine the count of Leaf nodes in an N-ary tree

Given the value of ‘N’ and ‘I’. Here, represents the number of internal nodes present in an N-ary tree and every node of the N-ary… Read More »

## Find the value of ln(N!) using Recursion

Given a number N, the task is to find the log value of the factorial of N i.e. log(N!). Note: ln means log with base… Read More »

## Calculate nCr using Pascal’s Triangle

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 »

## Count all possible N digit numbers that satisfy the given condition

Given an integer N, the task is to count all possible N digit numbers such that A + reverse(A) = 10N – 1 where A… Read More »

## Count the number of rhombi possible inside a rectangle of given size

Given a rectangle of height H and width W which has the bottom left corner at (0, 0). The task is to count the number… Read More »

## Maximize the sum of products of the degrees between any two vertices of the tree

Given an integer N, the task is to construct a tree such that sum of for all ordered pairs (u, v) is maximum where u… Read More »

## Count the total number of squares that can be visited by Bishop in one move

Given the position of a Bishop on an 8 * 8 chessboard, the task is to count the total number of squares that can be… Read More »

## An application on Bertrand’s ballot theorem

Given the number of ‘X’ and ‘Y’ in a string which consists of characters from the set {‘X’, ‘Y’}, the task is to find the… Read More »

## Minimum number of integers required to fill the NxM grid

Given a grid of size (NxM) is to be filled with integers. Filling of cells in the grid should be done in the following manner:… Read More »

## Check whether Bishop can take down Pawn or not

Given the position of a Bishop and a Pawn on a 8 * 8 chessboard, the task is to check whether the Bishop can take… Read More »

## Program to calculate the area between two Concentric Circles

Given two concentric circles with radius X and Y where (X > Y). Find the area between them. You are required to find the area… Read More »

## Find the values of X and Y in the Given Equations

Given two numbers and . Find the values of X and Y in the equations. A = X + Y B = X xor Y… Read More »

## Find maximum operations to reduce N to 1

Given two numbers A and B ( A and B can be up to 106 ) which forms a number N = (A!/B!). The task… Read More »

## Program to implement Inverse Interpolation using Lagrange Formula

Given task is to find the value of x for a given y of an unknown function y = f(x) where values of some points… Read More »