Skip to content

Tag Archives: subarray-sum

Given two arrays A[] and B[] both consisting of N integers, the task is to find the maximum length of subarray [i, j] such that… Read More
Given an array arr[] of N integers, the task is to find the maximum sum of subarray having length an at least 2 whose first… Read More
Given an array A of size n, find the maximum subarray sum after applying the given operation at most two times. In one operation, choose… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to update the given array by replacing the… Read More
Given an array arr[] consisting of N integers and two positive integers K and M, the task is to find the number of subarrays of… Read More
Given an array arr[] consisting of N integers, the task is to find the number of ways to split the array into non-empty subarrays such… Read More
Given an array arr[] of size N, the task is to find the maximum alternating sum of a subarray possible for a given array.  Alternating… Read More
Given an array arr[] of size N, the task is to find the minimum subarray sum in the subarrays [i, N-1] for all i in… Read More
Given an array arr[] of N integers, where each array element is either 0, 1, or 2, and an integer K, the task is to… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the largest sum of any contiguous… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum product of the subarray sum with the maximum element… Read More
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:Attention… Read More
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