## Longest sub-array whose product is 0

Given an array arr[] of integer elements, the task is to find the length of the longest sub-array whose product is 0. Examples: Input: arr[]… Read More »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- 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 Sum SubArray using Divide and Conquer | Set 2
- Maximum length of subarray such that sum of the subarray is even
- Find a subarray whose sum is divisible by size of the array
- Maximum subsequence sum such that all elements are K distance apart
- Maximum sum of non-overlapping subarrays of length atmost K
- Number of ways to divide an array into K equal sum sub-arrays
- Queries for number of distinct elements in a subarray | Set 2
- Count of triplets that satisfy the given equation
- Find minimum length sub-array which has given sub-sequence in it
- Find subarray with given sum with negatives allowed in constant space
- Maximize the subarray sum after multiplying all elements of any subarray with X
- Maximum length sub-array which satisfies the given conditions
- Divide an array into K subarray with the given condition
- Find array such that no subarray has xor zero or Y
- Sum of XOR of all sub-arrays of length K
- Longest Subarray having strictly positive XOR
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Find all unique pairs of maximum and second maximum elements over all sub-arrays in O(NlogN)
- Maximum possible sub-array sum after at most X swaps
- Number of Subarrays with positive product
- Bitwise AND of sub-array closest to K
- Length of longest sub-array with maximum arithmetic mean.
- Longest sub-array with equal number of alphabets and numeric characters
- Count number of permutation of an Array having no SubArray of size two or more from original Array
- Number of sub arrays with negative product
- Maximise array sum after taking non-overlapping sub-arrays of length K
- Generate an Array in which count of even and odd sum sub-arrays are E and O respectively

Given an array arr[] of integer elements, the task is to find the length of the longest sub-array whose product is 0. Examples: Input: arr[]… Read More »

Given an array arr[] and two integers X and Y. The task is to find a sub-array of size of atleast X and atmost Y… Read More »

Given an array arr[] of N positive integers, the task is to find the minimum LCM and GCD between elements of all possible sub-array. Examples:… Read More »

Given a sorted array A of n integers. The task is to find the sum of minimum of all possible subarrays of A. Examples: Input:… Read More »

Given a character array arr[] containing only lowercase English alphabets, the task is to print the maximum length of the subarray such that the first… Read More »

Given an integer K and an array arr[], the task is to split the array arr[] into K consecutive subarrays to find the maximum possible… Read More »

Given an array of N elements, the task is to find the longest subarray which is Fibonacci-like. A Fibonacci-like sub-array is defined as an array… Read More »

Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or… Read More »

Given an array arr[] of integers. The task is to return the length of the maximum size sub-array such that either one of the condition… Read More »

Given an array arr[] and an integer K, the task is to find whether the array can be divided into two sub-arrays such that the… Read More »

Given an array of integers arr[], the task is to find all the values for sum such that for a value sum[i] the array can… Read More »

Given an array arr[] of N integers. The task is to count the total number of subarrays of the given array such that difference between… Read More »

Given an array of N positive numbers, the task is to find a contiguous subarray (L-R) such that a[L]=a[R] and sum of a[L] + a[L+1]… Read More »

Given two arrays A[] and B[] consisting of and integers. The task is to check whether the array B[] is a subarray of the array… Read More »

Given an array of integer elements, the task is to find the length of the largest sub-array of such that all the elements of the… Read More »