# Tag Archives: subarray

Given an array, arr[] and a value k, represent the length of the subarray to be considered. Find the maximum sum that can be obtained… Read More
Given an array arr and a range [L, R], the task is to reverse the subarray in between the given range [L, R]. Examples: Input:… Read More
Given an array arr[] of length N, the task is to find the count of non-overlapping subarrays of size K such that the alternate elements… Read More
Given an arr[] of length N, the task is to make parity of arr[] the same by using the below-provided operation: Select a subarray containing… Read More
Given an array arr[] of length N, the task is to find the number of subarrays where the least common multiple (LCM) of the subarray… Read More
Given a positive integer array arr[] of size N, the task is to find the longest subarray such that the bitwise AND of every pair… Read More
Given an array arr[] of size, N, the task is to maximize the score to reduce the array to a single element by replacing any… Read More
Given an array arr[] of 1s and -1s, the task is to partition the array into maximum subarrays such that the sum of the alternating… Read More
Given a binary array A[] and an integer X, the task is to check whether it is possible to divide A[] into exactly X non-empty… Read More
Given an array nums[] of size N, the task is to find the maximum difference between the sum of even and odd indexed elements of… Read More
Given a binary array A[] of length N, the task is to find the minimum number of operations required so that array A is sorted… Read More
Given an arr[] of positive integers and start[] and end[] arrays of length L, Which contains the start and end indexes of L number of… Read More
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 of positive integers and an integer X, the task is to find the maximum number of adjacent… 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