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

# Tag Archives: sliding-window

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 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 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