Given a binary string S of length N and an integer K, the task is to find the maximum number of non-overlapping substrings that can… Read More

# Tag Archives: substring

Given a string str of size N and two integers M and K (N is divisible by M), the task is to find the Kth… Read More

Given a string S of length N consisting of numbers from(0-9) and also two numbers, one is even (say X)and one is odd (say Y),… Read More

Given a string S of length N, the task is to remove the longest prefix of the string which has at least one duplicate substring… Read More

Given a binary string str of size N, the task is to calculate the bitwise XOR of all substrings of str. Examples: Input: str =… Read More

Given a binary string S of length N, the task is to minimize the count of operations required to find a binary string T of… Read More

Given a string S of length N, the task is to find the length of the longest substring X of the string S such that:… Read More

Given a binary string S of length N, the task is to find the longest substring with at most X number of 0’s and Y… Read More

Given a string S. Find the longest Substring that starts with character C1, ends with character C3 and has at least one character C2 in… Read More

Given a string str of size N, the task is to check whether the given string is K-periodic, for all Ks in range [1, N].… Read More

Given a string S and an integer K, the task is to find the lexicographically smallest string possible after reversing any substring of any length… Read More

Given an array of string arr[] and a string str, the task is to print all the strings in arr[] that occur as a substring… Read More

Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence. If there are multiple… Read More

Given a binary string str of length N, the task is to count the maximum number of adjacent pairs of form “01” or “10” that… Read More

Given a string str of length N and an integer K, the task is to split the string into K sized groups and if the… Read More