Given a string S consisting of N characters, the task is to find the length of all prefixes of the given string S that are… Read More

# Tag Archives: substring

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 a string S, the task is to find all the substrings in the string S which is an anagram of another different substring in… Read More

Given three strings S, S1, and S2, the task is to check if the number of substrings that start and end with S1 and S2… Read More

Given a string S consisting of N lowercase alphabets, the task is to check if it is possible to split the string S into three… Read More

Given a string S of length N consisting only of characters ‘a’, ‘b’, and ‘c’, the task is to minimize the length of the given… Read More

Given a string S consisting of lowercase alphabets, the task is to check whether the given string can be rearranged such that the string can… Read More

Given a binary string S and an array A[], both of size N, the task is to find the maximum score possible by removing substrings… Read More

Given a string S consisting of N lowercase alphabets, the task is to find the length of the smallest substring in S whose occurrence is… Read More

Given circular binary string S of size N, the task is to count the minimum number of consecutive 0s required to be removed such that… Read More

Given two binary strings S1 and S2 of size N and M respectively, the task is to find the minimum number of reversal of substrings… Read More

Given a string S of length N, the task is to count the number of substrings made up of a single distinct character.Note: For the… Read More

Given a string S of length N and two integers M and K, the task is to count the number of substrings of length M… Read More

Given a positive integer N, the task is to find the number of binary strings of length N which contains “11” as a substring. Examples:… Read More

Given a string S, the task for every index of the string is to find the length of the longest palindromic substring that either starts… Read More