## Maximum sub-array sum after dividing array into sub-arrays based on the given queries

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 »

## Find the sums for which an array can be divided into sub-arrays of equal sum

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 »

## Minimum elements to change so that for an index i all elements on the left are -ve and all elements on the right are +ve

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 »

## Maximum sum subarray such that start and end values are same

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 »

## Count number of indices such that s[i] = s[i+1] : Range queries

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 »

## Partition an array such into maximum increasing segments

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 »

## Index with Minimum sum of prefix and suffix sums in an Array

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 »

## Count the number of vowels occurring in all the substrings of given string

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 »

## Check whether two strings can be made equal by increasing prefixes

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 »

## Find the value of max(f(x)) – min(f(x)) for a given F(x)

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 »

## Product of all primes in the range from L to R

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 »

## Sum of first N natural numbers by taking powers of 2 as negative number

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 »

## Sum of all Primes in a given range using Sieve of Eratosthenes

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 »

## Kth Smallest sum of continuous subarrays of positive numbers

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 »

## Check if a large number can be divided into two or more segments of equal sum

Given a very large Number N. The task is to check if the number can be divided into two or more segments of an equal… Read More »