# Tag Archives: subarray-sum

## Check if a subarray of length K with sum equal to factorial of a number exists or not

Given an array arr[] of N integers and an integer K, the task is to find a subarray of length K with sum of elements… Read More »

## Count maximum non-overlapping subarrays with given sum

Given an array arr[] consisting of N integers and an integer target, the task is to find the maximum number of non-empty non-overlapping subarrays such… Read More »

## Maximize product of subarray sum with its minimum element

Given an array arr[] consisting of N positive integers, the task is to find the maximum product of subarray sum with the minimum element of… Read More »

## Subarray of size K with prime sum

Given an array, arr[] of size N and an integer K, the task is to print a subarray of size K whose sum of elements… Read More »

## Replace every element in a circular array by sum of next K elements

Given a circular array arr[] of N integers and an integer K, the task is to print the array after the following operations: If K… Read More »

## Check if a subarray of size K exists whose elements form a number divisible by 3

Given an array arr[], of size N and a positive integer K, the task is to find a subarray of size K whose elements can… Read More »

## Maximize sum of remaining elements after every removal of the array half with greater sum

Given an array arr[] consisting of N integers, the task is to maximize the resultant sum obtained after adding remaining elements after every removal of… Read More »

## Find a subarray of size K whose sum is a perfect square

Given an array arr[] and an integer K, the task is to find a subarray of length K having sum which is a perfect square.… Read More »

## Check if the sum of a subarray within a given range is a perfect square or not

Given an array arr[] of size N and an array range[], the task is to check if the sum of the subarray {range, .. ,… Read More »

## First subarray having sum at least half the maximum sum of any subarray of size K

Given an array arr[] and an integer K, the task is to find the first subarray which has a sum greater than or equal to… Read More »

## Largest Sum Contiguous Subarray having unique elements

Given an array arr[] of N positive integers, the task is to find the subarray having maximum sum among all subarrays having unique elements and… Read More »

## Count array elements that can be represented as sum of at least two consecutive array elements

Given an array A[] consisting of N integers from a range [1, N], the task is to calculate the count of array elements (non-distinct) that… Read More »

## Maximize sum of an Array by flipping sign of all elements of a single subarray

Given an array arr[] of N integers, the task is to find the maximum sum of the array that can be obtained by flipping signs… Read More »

## Count of subarrays having sum equal to its length

Given an array arr[] of size N, the task is to find the number of subarrays having the sum of its elements equal to the… Read More »

## Maximum Subarray Sum possible by replacing an Array element by its Square

Given an array a[] consisting of N integers, the task is to find the maximum subarray sum that can be pbtained by replacing a single… Read More »