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

- Check whether an Array is Subarray of another Array
- Count pairs in array whose sum is divisible by K
- Length of the longest alternating subarray
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Check if array can be divided into two sub-arrays such that their absolute difference is K
- Maximum length of the sub-array whose first and last elements are same
- Find the sums for which an array can be divided into sub-arrays of equal sum
- Count sub-arrays whose product is divisible by k
- Find the longest Fibonacci-like subarray of the given array
- Maximum average of a subarray of size of atleast X and atmost Y
- Maximum sum subarray such that start and end values are same
- Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
- Range Queries to Find number of sub-arrays with a given xor
- Sum of minimum element of all subarrays of a sorted array
- Maximum Sum SubArray using Divide and Conquer | Set 2
- Maximum length of subarray such that sum of the subarray is even
- Maximum Subarray Sum after inverting at most two elements
- Maximize the maximum among minimum of K consecutive sub-arrays
- Minimum LCM and GCD possible among all possible sub-arrays
- Largest sub-array whose all elements are perfect squares
- Count Subarrays with Consecutive elements differing by 1
- Maximum size of sub-array that satisfies the given condition
- Count the number of non-increasing subarrays
- 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
- Maximize the subarray sum after multiplying all elements of any subarray with X
- Maximize the maximum subarray sum after removing atmost one element
- Minimum value among AND of elements of every subset of an array
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Longest sub-array whose product is 0
- Generate an Array in which count of even and odd sum sub-arrays are E and O respectively

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 »

Given an array of N integers. The task is to count the number of subarrays (of size at least one) that are non-increasing. Examples: Input… Read More »

Given an array, arr[] and a function F(i, j). The task is to compute max{F(i, j)} over all sub-arrays [i..j]. The fucntion F() is defined… Read More »

Given an integer K and an array arr[], the task is to count all the sub-arrays whose product is divisible by K. Examples: Input: arr[]… Read More »