## Maximum sum of non-overlapping subarrays of length atmost K

Given an integer array ‘arr’ of length N and an integer ‘k’, select some non-overlapping subarrays such that each sub-array if of length at most… Read More »

## Length of longest sub-array with maximum arithmetic mean.

Given an array of n-elements find the longest sub-array with the greatest arithmetic mean. The length of the sub-array must be greater than 1 and… Read More »

## Minimum length subarray of 1s in a Binary Array

Given binary array. The task is to find the length of subarray with minimum number of 1s. Note: It is guaranteed that there is atleast… Read More »

## Sum of XOR of all sub-arrays of length K

Given an array of length n ( n > k), we have to find the sum of xor of all the elements of the sub-arrays… Read More »

## Maximise array sum after taking non-overlapping sub-arrays of length K

Given an integer array arr[] of length N and an integer K, the task is to select some non-overlapping sub-arrays such that each sub-array is… Read More »

## Number of ways to divide an array into K equal sum sub-arrays

Given an integer K and an array arr[] of N integers, the task is to find the number of ways to split the array into… Read More »

## Maximum possible sub-array sum after at most X swaps

Given an array arr[] of N integers and an integer X, the task is to find the maximum possible sub-array sum after applying at most… Read More »

## Maximize the size of array by deleting exactly k sub-arrays to make array prime

Given an array arr[] of N positive integers and a non negative integer K. The task is to delete exactly K sub-arrays from the array… Read More »

## Bitwise AND of sub-array closest to K

Given an integer array arr[] of size N and an integer K, the task is to find the sub-array arr[i….j] where i ≤ j and… Read More »

## Generate an Array in which count of even and odd sum sub-arrays are E and O respectively

Given three integers N, E and O. The task is to find an array of size N such that the number of sub-arrays of sum… Read More »

## Maximum Sum SubArray using Divide and Conquer | Set 2

Given an array arr[] of integers, the task is to find the maximum sum sub-array among all the possible sub-arrays. Examples: Input: arr[] = {-2,… Read More »

## Maximum length of subarray such that sum of the subarray is even

Given an array of N elements. The task is to find the length of the longest subarray such that sum of the subarray is even.… Read More »

## Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time

Give an array arr[] of N integers and another integer k ≤ N. The task is to find the maximum element of every sub-array of… Read More »

## Maximize the subarray sum after multiplying all elements of any subarray with X

Given an array arr[] of N integers and an integer X. We can choose any sub-array and multiply all its element by X. After multiplication,… Read More »

## Maximize the maximum subarray sum after removing atmost one element

Given an array arr[] of N integers. The task is to first find the maximum sub-array sum and then remove at most one element from… Read More »