# Category Archives: Algorithms (adsbygoogle = window.adsbygoogle || []).push({});

## Occurrences of a pattern in binary representation of a number

Given a string pat and an integer N, the task is to find the number of occurrences of the pattern pat in binary representation of… Read More »

## Pairs with same Manhattan and Euclidean distance

In a given Cartesian plane, there are N points. The task is to find the Number of Pairs of points(A, B) such that Point A… Read More »

## Choose n elements such that their mean is maximum

Given an array of 2 * n elements, the task is to construct and print an array of n element such that the mean of… Read More »

## Remove exactly one element from the array such that max – min is minimum

Given an array consisting of N positive integer numbers. The task is to remove exactly one element from this array to minimize max(a) – min(a)… Read More »

## Smallest power of 2 which is greater than or equal to sum of array elements

Given an array of N numbers where values of the array represent memory sizes. The memory that is required by the system can only be… Read More »

## Check whether a + b = c or not after removing all zeroes from a,b and c

Given two integers a and b, the task is to add them to get c. After that remove zeroes from a, b and c and… Read More »

## Check if a number is perfect square without finding square root

We need to check whether a number is a perfect square or not without finding its square root. Examples: Input : n = 36 Output… Read More »

## Check if N is Strong Prime

Given a positive integer N, the task is to check if N is a strong prime or not. In number theory, a strong prime is… Read More »

## Minimum Numbers of cells that are connected with the smallest path between 3 given cells

Given coordinates of 3 cells (X1, Y1), (X2, Y2) and (X3, Y3) of a matrix. The task is to find the minimum path which connects… Read More »

## Find the sums for which an array can be divided into sub-arrays of equal sum

Given an array of integers arr[], the task is to find all the values for sum such that for a value sum[i] the array can… Read More »

## Find the number in a range having maximum product of the digits

Given a range represented by two positive integers L and R. Find the number lying in the range having the maximum product of the digits.… Read More »

## Count number of step required to reduce N to 1 by following certain rule

Given a positive integer . Find the number of steps required to minimize it to 1. In a single step N either got reduced to… Read More »

## Recursive Program for Binary to Decimal

Given a binary number as string, find its decimal equivalent. Examples: Input : binary = “101” Output : 5 Input : binary = “1111” Output… Read More »

## Area of a n-sided regular polygon with given Radius

Given a regular polygon of N sides with radius(distance from the center to any vertex) R. The task is to find the area of the… Read More »

## Area of a n-sided regular polygon with given side length

Given a regular polygon of N sides with side length a. The task is to find the area of the polygon. Examples: Input : N… Read More »