## 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 »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Count pairs in array whose sum is divisible by K
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greatest contiguous sub-array of size K
- Maximum length of subarray such that sum of the subarray is even
- Maximum Sum SubArray using Divide and Conquer | Set 2
- Range Queries to Find number of sub-arrays with a given xor
- Find a subarray whose sum is divisible by size of the array
- Maximum sum of non-overlapping subarrays of length atmost K
- Count sub-arrays whose product is divisible by k
- Find minimum length sub-array which has given sub-sequence in it
- Number of ways to divide an array into K equal sum sub-arrays
- Maximum Subarray Sum after inverting at most two elements
- Maximize the subarray sum after multiplying all elements of any subarray with X
- Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
- Maximum average of a subarray of size of atleast X and atmost Y
- Sum of XOR of all sub-arrays of length K
- Maximize the maximum subarray sum after removing atmost one element
- Find array such that no subarray has xor zero or Y
- Maximum length sub-array which satisfies the given conditions
- Longest Subarray having strictly positive XOR
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Count the number of non-increasing subarrays
- Maximum possible sub-array sum after at most X swaps
- Count the number of sub-arrays such that the average of elements present in the sub-array is greater than that not present in the sub-array
- Length of longest sub-array with maximum arithmetic mean.
- Bitwise AND of sub-array closest to K
- Longest sub-array with equal number of alphabets and numeric characters
- Longest sub-array whose product is 0
- Queries for number of distinct elements in a subarray | Set 2

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

Given an array of integers arr[], the task is to count the number of sub-arrays such that the average of elements present in the sub-array… Read More »

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

Given an array arr[] of integer elements, the task is to find maximum possible sub-array sum after changing the signs of at most two elements.… Read More »