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

# Tag Archives: sliding-window

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 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[] consisting of N distinct integers and an integer K, the task is to find the maximum MEX from all subarrays of… 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