Skip to content

Tag Archives: sliding-window

Given a binary circular array arr[] of size N, the task is to find the minimum swaps to group all 0s together in the array.… Read More
Given two arrays X[] and Y[] of size N, the task is to find the longest subarray in X[] containing only unique values such that… Read More
Given a string str of length N (divisible by 3) consisting of atmost three distinct characters, the task is to find the length of the… Read More
Given an array nums[] and a value k. The task is to find the maximum elements that can be made equal with at most k… Read More
Given a binary array arr[] of N integers, the task is to find the maximum count of distinct sized subarrays such that the sum of… Read More
Given an array arr[] containing N positive integers and an integer K. The task is to replace every array element with the average of previous… Read More
Given an array arr[] of N integers and an integer K, the task is to find the length of the longest subarray that forms an… Read More
Given an array arr[] containing integers. The task is to find the number of decreasing subarrays with a difference of 1.  Examples:  Input: arr[] =… Read More
Given binary string str, the task is to find the count of K length subarrays containing only 1s. Examples Input: str = “0101000”, K=1Output: 2Explanation:… Read More
Given an array arr[] of N elements and an integer K. The task is to find the maximum sum of elements in a subarray of… Read More
Given two arrays W[] and C[] containing weight and cost of N (1 to N) items respectively, and an integer K, find a segment from… Read More
Given an array arr[] containing N integers and an integer K, the task is to find the maximum value of the product of Bitwise AND… Read More
Given an array arr[] of length N, the task is to find the minimum product of subarray of size K of an array including negative… Read More
Given an array arr[] of N integers, find the length of the longest subarray having sum in the range [L, R]. Examples:   Input: arr[]… Read More
Given an array arr[] having N integers in non-decreasing order and an integer K, the task is to find the minimum value of (j –… Read More

Start Your Coding Journey Now!