# Tag Archives: sliding-window

## Count of Array elements greater than or equal to twice the Median of K trailing Array elements

Given an array A[] of size greater than integer K, the task is to find the total number of elements from the array which are… Read More »

## Count of N digit Numbers whose sum of every K consecutive digits is equal

Given two integers N and K, the task is to find the total count of N-digit number such that the sum of every K consecutive… Read More »

## Minimum replacements in a string to make adjacent characters unequal

Given a lowercase characters string str of size N. In one operation any character can be changed into some other character. The task is to… Read More »

## Count of substrings of a given Binary string with all characters same

Given a binary string str containing only 0 and 1, the task is to find the number of sub-strings containing only 1s and 0s respectively,… Read More »

## Min difference between maximum and minimum element in all Y size subarrays

Given an array arr[] of size N and integer Y, the task is to find a minimum of all the differences between the maximum and… Read More »

## Median of sliding window in an array | Set 2

Prerequisites: Policy based data structure, Sliding window technique. Given an array of integer arr[] and an integer K, the task is to find the median… Read More »

## Maximum sum subarray of size range [L, R]

Given an integer array arr[] of size N and two integer L and R. The task is to find the maximum sum subarray of size… Read More »

## Generate a string whose all K-size substrings can be concatenated to form the given string

Given a string str of size N and an integer K, the task is to generate a string whose substrings of size K can be… Read More »

## Maximum absolute difference between sum of subarrays of size K

Given an array arr[] of size N and an integer K, the task is to find maximum absolute difference between the sum of subarrays of… Read More »

## Minimum flips required in a binary string such that all K-size substring contains 1

Given a binary string str of size N and a positive integer K, the task is to find the minimum number of flips required to… Read More »

## Count of longest possible subarrays with sum not divisible by K

Given an array of integers arr[] and a positive integer K, the task is to find the count of the longest possible subarrays with sum… Read More »

## Count of substrings of length K with exactly K distinct characters

Given a string str of lowercase alphabets and an integer K, the task is to count all substrings of length K which have exactly K… Read More »

## Count of subarrays of size K with elements having even frequencies

Given an Array arr[] and an integer K, the task is to count subarrays of size K in which every element appears even number of… Read More »

## Minimum bit flips such that every K consecutive bits contain at least one set bit

Given a binary string S, and an integer K, the task is to find the minimum number of flips required such that every substring of… Read More »

## Maximum number of set bits count in a K-size substring of a Binary String

Given a binary string S of size N and an integer K. The task is to find the maximum number of set bit appears in… Read More »