Skip to content

Tag Archives: subarray-sum

Given an array arr[] consisting of N integers, the task is to replace minimum number of pairs of adjacent elements by their sum to make… 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 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
Given an array arr[] and two integers K and X, the task is to find the maximum sum among all subarrays of size K with… Read More
Given an array arr[] consisting of N integers, the task is to rearrange the array such that sum of all subarrays starting from the first… Read More
Given an array arr[] of integers and an integer K, the task is to find the length of the smallest subarray that needs to be… Read More
Given an array arr[] of size N, the task is to find the number of subarrays having sum of its elements equal to the number… Read More