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

# Tag Archives: sliding-window

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