## Construct sum-array with sum of elements in given range

You are given an array of n-elements and an odd-integer m. You have to construct a new sum_array from given array such that sum_array[i] =… Read More »

- Count of substrings which contains a given character K times
- Maximum sum of K consecutive nodes in the given Linked List
- Minimum cost to modify a string
- Number of sub-strings that contain the given character exactly k times
- Minimum number of elements to be removed such that the sum of the remaining elements is equal to k
- Find subarray with given sum with negatives allowed in constant space
- Minimum increment operations to make K elements equal

You are given an array of n-elements and an odd-integer m. You have to construct a new sum_array from given array such that sum_array[i] =… Read More »

You are given an array of n-elements you have to find the mean of the array as mean of all consecutive m-elements of array for… Read More »

Given an array of N elements and L and R, print the number of sub-arrays such that the value of the maximum array element in… Read More »

Given an array of integers and k, find the difference between the number of the strictly increasing number of subarrays (of size more than one)… Read More »

Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that… Read More »

Given N elements and a number K, find the longest subarray which has not more than K distinct elements.(It can have less than K) Examples:… Read More »

We are given an array a consisting of n integers and an integer k. We need to find the minimum range in array [l, r]… Read More »

Given an array of n integers, for each element, print the distance to the closest zero. Array has a minimum of 1 zero in it.… Read More »

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 »

Given an array of integer and two value k and i where k is number of moves and i is index in array. Task is… Read More »

Given an array of integers, our goal is to find the length of largest subarray having sum of its elements atmost ‘k’ where k>0. Examples:… Read More »

Given a string of length N, find the length of the smallest sub-string consisting of maximum distinct characters. Note : Our output can have same… Read More »

Given an array of integers and a sum. We have to find sum of subarray having maximum sum less than or equal to given sum… Read More »

A string defining a valid number is given. Output all the base conversions of substrings of length ‘k’ from base ‘b’ to base 10. Examples:… Read More »

Given an array and a number k, the task is to calculate the sum of the product of all elements of subarrays of size k.… Read More »