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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum.
Given n numbers, each with some frequency of occurrence. Return a random number with probability proportional to its frequency of occurrence.
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 »