Given an array arr[] consisting of N non-negative integers, the task is to find the minimum length of the subarray whose sum is maximum. Example:… Read More

# Tag Archives: subarray-sum

Given an array arr[] consisting of N integers, the task is to find the maximum sum of any subarray possible after removing at most one… Read More

Given an integer K and an array A[] of size N, the task is to create a new array with sum K with minimum number… Read More

Given two arrays arr[] and brr[] of size N and M integers respectively, the task is to maximize the sum of the product of the… Read More

Given an array arr[] consisting of N integers, the task is to replace a minimum number of pairs of adjacent elements by their sum to… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to reduce K to 0 by removing an array element… Read More

Prerequisite: Kadane’s algorithm Given a 2D array arr[][] of dimension N*M, the task is to find the maximum sum sub-matrix from the matrix arr[][]. Examples:… Read More

Given two positive integers N and K, the task is to generate an array consisting of N distinct integers such that the sum of elements… Read More

Given two arrays arr[] and brr[] consisting of N and K elements respectively, the task is to find the maximum subarray sum possible from the… Read More

Given an array arr[] of positive integers of size N, the task is to check if there exists two non-intersecting subarrays in arr[] such that… Read More

Given an array arr[] of length N, the task is to find the count of pairs of indices (i, j) (0-based indexing) such that prefix… Read More

Given an array arr[] of size N and an integer K, the task is to find the maximum subarray sum by removing at most K… Read More

Given two arrays arr[] and brr[] and an integer C, the task is to find the maximum possible length, say K, of the same indexed… Read More

Given an array arr[] consisting of N integers, the task is to count the number of ways to split the array into two subarrays of… Read More

Given an array arr[] consisting of N integers and an array Q[][], where each row denotes a range {l, r}(0 ≤ l ≤ r ≤… Read More

What's New