Skip to content

Tag Archives: sliding-window

Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the maximum sum of the subarray… Read More
Given a string S consisting of N lowercase characters, the task is to find the length of the longest substring that does not contain any… Read More
Given an array arr[] consisting of N positive integers and an integer K, the task is to find the highest frequency of any array element… Read More
Given an array arr[] of size N and an integer K, the task is to count the number of negative elements present in all K-length… Read More
Given an array arr[] of size N and an integer K, the task is to find the maximum possible frequency of any array element by… Read More
Given a string S consisting of lowercase characters and an integer K, the task is to find the maximum length of a subsequence consisting of… Read More
Given an integer K and an array A[] of size N, the task is to create a new array with sum K with minimum number… Read More
Given a string S consisting of N characters and a positive integer K, the task is to count the number of substrings having at least… Read More
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