##
Find the Sub-array with sum closest to 0
July 3, 2017

Given an array of both positive and negative numbers, the task is to find out the subarray whose sum is closest to 0. There can… Read More »

July 3, 2017

Given an array of both positive and negative numbers, the task is to find out the subarray whose sum is closest to 0. There can… Read More »

May 18, 2017

Given a array of n numbers. Our task is to find out the number of ways to divide the array into three contiguous parts such… Read More »

May 14, 2017

Given an array, we need to find two subarrays with a specific length K such that sum of these subarrays is maximum among all possible… Read More »

May 10, 2017

Introduction and Implementation : Given an array arr[] of size n, its prefix sum array is another array prefixSum[] of same size such that the… Read More »

April 24, 2017

You are given a list of N coins of different denominations. you can pay an amount equivalent to any 1 coin and can acquire that… Read More »

March 2, 2017

Given an array of n elements and an integer m. The task is to find the maximum value of the sum of its subarray modulo… Read More »

January 12, 2017

Given n ranges of the form L and R, the task is to find the maximum occurred integer in all the ranges. If more than… Read More »

December 30, 2016

Given an array of n positive integers and a positive integer k, the task is to find the maximum subarray size such that all subarrays… Read More »

December 1, 2016

Given an array of limits. For every limit, find the prime number which can be written as the sum of the most consecutive primes smaller… Read More »

December 25, 2015

Given two binary arrays arr1[] and arr2[] of same size n. Find length of the longest common span (i, j) where j >= i such… Read More »

April 2, 2014

Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum.

June 6, 2013

Given n numbers, each with some frequency of occurrence. Return a random number with probability proportional to its frequency of occurrence.

January 7, 2011

Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at… Read More »