## Range sum queries without updates

Given an array arr of integers of size n. We need to compute sum of elements from index i to index j. The queries consisting… Read More »

## Array range queries over range queries

Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands… Read More »

## Maximum area rectangle by picking four sides from array

Given an array of n positive integers that represent lengths. Find out the maximum possible area whose four sides are picked from given array. Note… Read More »

## Minimum operation to make all elements equal in array

Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition,… Read More »

## Minimum operations to make XOR of array zero

We are given an array of n elements. The task is to make XOR of whole array 0. We can do following to achieve this.… Read More »

## Symmetric difference of two sorted array

There are two sorted array arr1 and arr2. We have to find the symmetric difference of Aarr1 and arr2. Symmetric Difference basically contains all elements… Read More »

## Efficiently merging two sorted arrays with O(1) extra space

Given two sorted arrays, we need to merge them in O((n+m)*log(n+m)) time with O(1) extra space into a sorted array, when n is the size… Read More »

## Positive elements at even and negative at odd positions

You have been given an array and you have to make a program to convert that array such that positive elements occur at even numbered… Read More »

## Find the index of first 1 in an infinite sorted array of 0s and 1s

Given an infinite sorted array consisting 0s and 1s. The problem is to find the index of first ‘1’ in that array. As the array… Read More »

## Find the sum of maximum difference possible from all subset of a given array.

We are array arr[] of n non-negative integers (repeated elements allowed), find out the sum of maximum difference possible from all subsets of given array.… Read More »

## Maximum sum bitonic subarray

Given an array containing n numbers. The problem is to find the maximum sum bitonic subarray. A bitonic subarray is a subarray in which elements… Read More »

## Longest increasing subarray

Given an array containing n numbers. The problem is to find the length of the longest contiguous subarray such that every element in the subarray… Read More »

## Find minimum cost to buy all books

Given an array of ratings for n books. Find the minimum cost to buy all books with below conditions : Cost of every book would… Read More »

## Find an element in array such that sum of left array is equal to sum of right array

Given, an array of size n. Find an element which divides the array in two sub-arrays with equal sum. Examples: Input : 1 4 2… Read More »

## Minimum absolute difference of XOR values of two subarrays

Given an array containing n numbers. The problem is to split the array into two subarrays such that the absolute difference of the xor values… Read More »