# Tag Archives: subarray-sum

Given an array A[] of size N. In one operation only one subarray can be selected and replaced with the sum of the subarray. The… Read More
Given two arrays A[] and B[] having lengths N and M respectively, Where A[] and B[] can contain both positive and negative elements, the task… Read More
Given an array A[ ] of size N, the task is to check if the sum of every even-sized subarray is 0 or not. Examples:… Read More
Given a matrix mat[][] of size M x N where mat[i][j], the task is to find the maximum possible sum by picking contiguous elements from… Read More
Given an array arr[] of size N, the task is to find the maximum subarray sum that can be obtained such that the length of… Read More
Given an array A consisting of N integers, the task is to find the maximum sum of two non-overlapping subarrays of any length of the… Read More
Given two arrays A[] and B[] each of size N, the task is to minimize the sum of an array by swapping a subarray. Examples: … Read More
Given an array arr[] of size N, the task is to find the minimum difference between the maximum and the minimum subarray sum when the… Read More
Given two arrays X[] and Y[] of size N, the task is to find the longest subarray in X[] containing only unique values such that… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
Given an array arr[] of size N and an integer K., The task is to count the number of subarrays with unique sum with sum… Read More