Skip to content

Tag Archives: sliding-window

Given an array arr[] consisting of N integers and an integer K, the task is to print the maximum sum possible in a subsequence satisfying… Read More
Given two strings S1 and S2, the task is to check if S2 contains an anagram of S1 as its substring. Examples:   Input: S1 =… Read More
Given a string str and an integer K, the task is to find the length of the longest substring S such that every character in… Read More
Given a string S of length N, the task is to find the smallest balanced substring in S. If no such substring is present, print… Read More
Given an array arr[] of size N, the task is to check if any subarray of size K exists in the array or not, whose… Read More
Given an array arr[] of size N and an integer K, the task is to count the number of subarrays which consists of first K… Read More
Given an array arr[] of size N and an integer K, the task is to find the maximum number of even numbers present in any… Read More
Given a binary string S of length N, the task is to find the longest substring consisting of ‘1’s only present in the string after… Read More
Given an array arr[] and two integers K and X, the task is to find the maximum sum among all subarrays of size K with… Read More
Given an array arr[] consisting of N distinct integers and an integer K, the task is to find the maximum MEX from all subarrays of… Read More
Given an array arr[ ] consisting of N integers, the task is to determine the maximum number of perfect Numbers in any subarray of size… Read More
Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence. Examples: Input: A =… Read More
Given an array arr[], consisting of N integers in the range [0, 9], the task is to find a subarray of length K from which… Read More
Given an array arr[] consisting of N positive integers and an integer K, which represents the maximum number that can be added to the array… Read More