Skip to content

Tag Archives: substring

Given string S consisting of lowercase and uppercase letters, the task is to find the number of substrings having the equal number of lowercase and… Read More
Given a numeric string S consisting of N digits, the task is to find the minimum length of the string that can be formed by… Read More
Given a string S and integers P and Q, which denotes the cost of removal of substrings “ab” and “ba” respectively from S, the task… Read More
Given a string S consisting of N lowercase characters, the task is to find the starting and the ending indices ( 0-based indexing ) of… Read More
Given a string S consisting of N lowercase alphabets, the task is to count the number of substrings whose frequency of each character is even.… Read More
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
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