## Two equal sum segment range queries

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… 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
- 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
- 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
- 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 arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

Given an array arr[] and an integer k, we can cut this array at k different positions where k[] stores the positions of all the… Read More »

Given an array of integers arr[], the task is to find all the values for sum such that for a value sum[i] the array can… Read More »

Given an array arr of size n, the task is to find the minimum number of elements that should be changed (element value can be… Read More »

Given an array of N positive numbers, the task is to find a contiguous subarray (L-R) such that a[L]=a[R] and sum of a[L] + a[L+1]… Read More »

Given a string str. Now for every query consisting of two integer L and R, the task is to find the number of indices such… Read More »

We are given an array of N integers, we need to partition the array into segments such that every element of a segment is greater… Read More »

Given an Array of integers. The task is to find the index in the array at which the value of prefixSum(i) + suffixSum(i) is minimum.… Read More »

Given a string of length N of lowercase characters containing 0 or more vowels, the task is to find the count of vowels occurred in… Read More »

In this problem we have to check. whether two strings can be made equal by increasing the ASCII value of characters of the prefix of… Read More »

Given two sequences of N integers consisting of both positive and negative integers inclusive 0 (sequence A and sequence B). Then there will be Q… Read More »

Given a range [L, R]. The task is to find the product of all the prime numbers in the given range from L to R… Read More »

Given a number N ( maybe up to 10^9 ). The task is to find the sum of first N natural number taking powers of… Read More »

Given a range [L, R]. The task is to find the sum of all the prime numbers in the given range from L to R… Read More »

Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More »