## Number of subarrays whose minimum and maximum are same

Given an array of n integers, find the no of subarrays whose minimal and maximum elements are same. Subarray is defined as non-empty sequence of… Read More »

## K-th Largest Sum Contiguous Subarray

Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative… Read More »

## Number of subarrays having product less than K

Given an Array of positive numbers, calculate the number of possible contigous subarrays having product lesser than a given number K. Examples : Input :… Read More »

## Number of subarrays for which product and sum are equal

Given a array of n numbers. We need to count the number of subarrays having the product and sum of elements are equal Examples: Input… Read More »

## Maximum sum two non-overlapping subarrays of given size

Given an array, we need to find two subarrays with a specific length K such that sum of these subarrays is maximum among all possible… Read More »

## Split an array into two equal Sum subarrays

Given an array of integers greater than zero, find if it is possible to split it in two subarrays (without reordering the elements), such that… Read More »

## XOR of all subarray XORs | Set 1

Given an array of integers, we need to get total XOR of all subarray XORs where subarray XOR can be obtained by XORing all elements… Read More »

## Count all sub-arrays having sum divisible by k

You are given an array of positive and/or negative integers and a value K . The task is to find count of all sub-arrays whose… Read More »

## Maximum subarray size, such that all subarrays of that size have sum less than k

Given an array of n positive integers and a positive integer k, the task is to find the maximum subarray size such that all subarrays… Read More »

## Subarrays with distinct elements

Given an array, the task is to calculate the sum of lengths of contiguous subarrays having all elements distinct. Examples: Input : arr[] = {1,… Read More »