## Partitioning into two contiguous element subarrays with equal sums

Given an array of n positive integers. Find a minimum positive element to be added to one of the indexes in the array such that… Read More »

- Minimum value to add to arr[i] so that an array can be split at index i with equal sum
- Find the sums for which an array can be divided into sub-arrays of equal sum
- Partition the array into three equal sum segments
- Count number of ways to divide an array into two halves with same sum
- Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
- Two equal sum segment range queries
- 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
- Rearrange the array to maximize the number of primes in prefix sum of the array
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Number of subarrays having sum of the form k^m, m >= 0
- Sum of all odd factors of numbers in the range [l, r]
- Generate an Array in which count of even and odd sum sub-arrays are E and O respectively
- Sum of all even factors of numbers in the range [l, r]
- Queries to answer the number of ones and zero to the left of given index
- Count the number of primes in the prefix sum array of the given array
- Replace all elements by difference of sums of positive and negative numbers after that element
- Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors
- Maximum sub-array sum after dividing array into sub-arrays based on the given queries

Given an array of n positive integers. Find a minimum positive element to be added to one of the indexes in the array such that… Read More »

Consider an array of size n with initial 0 values. How many indices will contain value at least x after performing m range updates. In… Read More »

Given an array and two numbers M and K. We need to find sum of max M subarrays of size K (non-overlapping) in the array.… Read More »

Given an array, we partition a row of numbers A into at most K adjacent (non-empty) groups, then the score is the sum of the… Read More »

Given an array arr[]. Find maximum value of prefix sum which is also suffix sum for index i in arr[]. Examples : Input : arr[]… Read More »

Given a matrix (or 2D array) a[][] of integers, find prefix sum matrix for it. Let prefix sum matrix be psa[][]. The value of psa[i][j]… Read More »

Given an array of n elements, the task is to find the fibonacci sum of a subset of the array where every element of the… Read More »

Given an array of non-negative integers and range query l, r, find number of prefix sum which are prime numbers in that given range. Prerequisite… Read More »

Given an array A of size N, and a number K. Task is to find out if it is possible to partition the array A… Read More »

Consider an array A of n integers. Determine if array A can be split into three consecutive parts such that sum of each part is… Read More »

Given an array arr[] of n integers. The task is to find the sum of product of each element with each element after it in… Read More »

Given N numbers and Q queries, every query consists of L and R, task is to find the number of such integers i (L<=i<R) such… Read More »

Given an array of 0’s and 1’s, we need to write a program to find the minimum number of swaps required to group all 1’s… Read More »

Given an array of N integers. We need to find an index such that Frequency of Even numbers on its left side is equal to… Read More »

Given a string s, count special substrings in it. A Substring of S is said to be special if either of the following properties is… Read More »