## 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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »