Skip to content

Tag Archives: subarray

Given an array arr[] of size N, the task is to find the maximum number of sub-arrays such that the GCD(Greatest Common Factor) of all… Read More
Given an array arr[] of length N consisting positive integers and an integer X, the task is to find the maximum number of adjacent Sub-Arrays… Read More
Given an array arr[] of length N, the task is to find the total number of elements that has frequency 1 in a subarray of… Read More
Given an array A[] consisting of N elements, the task is to find the minimum length of the subarray starting from each index and the… Read More
Given an array A[] and M, the task is to check whether there exist M non-overlapping subarrays(non-empty) of A for which the average of the… Read More
Given a sorted array arr[] of size N and integer K, the task is to split the array into K non-empty subarrays such that the… Read More
Given an array A[] of size N, the task is to find the total number of positions in all the subarrays such that the value… Read More
Given a strictly increasing array A[] of size N, an integer K and Q queries of type [L, R], the task is to count the… Read More
Given an array arr[] of N elements ranging from 0 to N-1(both included), the task is to rearrange the array such that the sum of… Read More
Given a binary array a[] or size N and an integer K, the task is to find the longest subarray consisting of only 1s or… Read More
Given an array of size N. Consider all the subarrays starting at each index from [0, N – 1]. Determine the length of the smallest… Read More
Given a binary array A[] of size N, the task is to find the minimum number of subarrays that need to be reversed to sort… Read More
Given an array arr[] of N integers. the task is to find the minimum number of operations required to make all the elements of the… Read More
Given an array A consisting of N integers, the task is to find the maximum sum of two non-overlapping subarrays of any length of the… Read More
Given two arrays A[] and B[] each of size N, the task is to minimize the sum of an array by swapping a subarray. Examples: … Read More

Start Your Coding Journey Now!