## Minimum halls required for class scheduling

Given N lecture timings, with their start time and end time (both inclusive), the task is to find the minimum number of halls required to… Read More »

## Find a subarray whose sum is divisible by size of the array

Given an array arr[] of length N. The task is to check if there exists any subarray whose sum is a multiple of N. If… Read More »

## Count number of ways to divide an array into two halves with same sum

Given an integer array of N elements. The task is to find the number of ways to split the array into two equal sum sub-arrays… Read More »

## Maximize the size of array by deleting exactly k sub-arrays to make array prime

Given an array arr[] of N positive integers and a non negative integer K. The task is to delete exactly K sub-arrays from the array… Read More »

## Rearrange the array to maximize the number of primes in prefix sum of the array

Given an array arr[] of 1’s and 2’s, the task is to re-arrange the array in such a way that the prefix sum of the… Read More »

## Count the number of primes in the prefix sum array of the given array

Given an array arr[] of N integers, the task is to count the number of primes in the prefix sum array of the given array.… Read More »

## Generate an Array in which count of even and odd sum sub-arrays are E and O respectively

Given three integers N, E and O. The task is to find an array of size N such that the number of sub-arrays of sum… Read More »

## Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors

Given an integer N. The task is to find the number of integers 1 < x < N, for which x and x + 1… Read More »

## Count the number of sub-arrays such that the average of elements present in the sub-array is greater than that not present in the sub-array

Given an array of integers arr[], the task is to count the number of sub-arrays such that the average of elements present in the sub-array… Read More »

## Find the number of sub arrays in the permutation of first N natural numbers such that their median is M

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

## Queries to answer the number of ones and zero to the left of given index

Given a binary array and Q queries. Every query consists of a number K, the task is to print the number of ones and zeros… Read More »

## Minimum value to add to arr[i] so that an array can be split at index i with equal sum

Given an array arr[] of integers, the task is to find the minimum non-negative integer k such that there exists an index jin the given… Read More »

## Number of subarrays having sum of the form k^m, m >= 0

Given an integer k and an array arr[], the task is to count the number of sub-arrays which have the sum equal to some positive… Read More »

## Partition the array into three equal sum segments

Given an array of n integers, we have to partition the array into three segments such that all the segments have equal sum. Segment sum… Read More »

## Replace all elements by difference of sums of positive and negative numbers after that element

Given an array of positive and negative elements. The task is to replace every i-th element of the array by the absolute difference of absolute… Read More »