## Find the non decreasing order array from given array

Given an array A[] of size N / 2, the task is to construct the array B[] of size N such that: B[] is sorted… Read More »

## Largest number less than X having at most K set bits

Given an integer X > 1 and an integer K > 0, the task is to find the greatest odd number < X such that… Read More »

## Greatest divisor which divides all natural number in range [L, R]

Given two integers L and R, the task is to find the greatest divisor that divides all the natural numbers in the range [L, R].… 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 »

## Buy minimum items without change and given coins

You have an unlimited number of 10-rupee coins and exactly one coin of r rupee and you need to buy minimum items each of cost… Read More »

## Minimize the maximum minimum difference after one removal from array

Given an array arr[] of size n ≥ 3, the task is to find the minimum possible difference between the maximum and the minimum element… Read More »

## Minimum number of consecutive sequences that can be formed in an array

Given an array of integers. The task is to find the minimum number of consecutive sequences that can be formed using the elements of the… Read More »

## Count of lines required to write the given String

Given a string str and an integer array width[] where: width[0] = width of character ‘a’ width[1] = width of character ‘b’ … width[25] =… Read More »

## Maximum sum by picking elements from two arrays in order

Given two arrays of size N and two integers X and Y indicating the maximum number of elements one can pick from array A and… Read More »

## Check if elements of an array can be arranged satisfying the given condition

Given an array arr of N (even) integer elements. The task is to check if it is possible to reorder the elements of the array… Read More »

## Count valid pairs in the array satisfying given conditions

Given an array of integers arr[], the task is to count the number of valid pairs of elements from arr. A pair (arr[x], arr[y]) is… Read More »

## Maximum sum of all elements of array after performing given operations

Given an array of integers. The task is to find the maximum sum of all the elements of the array after performing the given two… Read More »

## Minimize the difference between minimum and maximum elements

Given an array of integers and an integer . It is allowed to modify an element either by increasing or decreasing them by k (only… Read More »

## Dijkstra’s shortest path with minimum edges

Prerequisite: Dijkstra’s shortest path algorithm Given an adjacency matrix graph representing paths between the nodes in the given graph. The task is to find the… Read More »