## Subarray whose absolute sum is closest to K

Given an array of n elements and an integer K, the task is to find the subarray with minimum value of ||a[i] + a[i +… Read More »

- Sliding Window Maximum : Set 2
- Median of sliding window in an array
- Basic Algorithm Techniques Not Taught in Academics
- Submatrix of given size with maximum 1's
- Length of the smallest substring which contains all vowels
- Count of substrings of length K with exactly K distinct characters
- Sum of all subarrays of size K
- Maximum number of set bits count in a K-size substring of a Binary String
- Shortest subarray to be removed to make all Array elements unique
- Longest subarray in which absolute difference between any two element is not greater than X
- Find subarray of Length K with Maximum Peak
- Count subarrays with sum equal to its XOR value
- Count of subarrays of size K with elements having even frequencies
- Remove k corner elements to maximize remaining sum
- Find the subarray of size K with minimum XOR
- Maximum count number of valley elements in a subarray of size K
- Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
- Maximize sum of K elements in Array by taking only corner elements
- Minimum bit flips such that every K consecutive bits contain at least one set bit
- Find maximum Subsequence Sum according to given conditions

Given an array of n elements and an integer K, the task is to find the subarray with minimum value of ||a[i] + a[i +… Read More »

Given an array arr[] of positive integers and a range (L, R). Find number of subarrays having sum in the range L to R. Examples:… Read More »

Given an array of 0s and 1s, find the position of 0 to be replaced with 1 to get longest continuous sequence of 1s. Expected… Read More »

You are given two Integers N and M, and print all the terms of the series upto M-terms of the N-bonacci Numbers. For example, when… Read More »

Given an array of N non-negative integers, task is to find the maximum size of a subarray such that the pairwise sum of the elements… Read More »

Given an array of non-negative numbers and a non-negative number k, find the number of subarrays having sum less than k. We may assume that… Read More »

Given an array of positive numbers and a number k, find the number of subarrays having product exactly equal to k. We may assume that… 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 a large number as string s and an integer k which denotes the number of breakpoints we must put in the number k <=… Read More »

Given an array of size n. The problem is to find the longest sub-array having exactly k odd numbers. Examples: Input : arr[] = {2,… Read More »

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 »