Skip to content

Tag Archives: substring

Given string str of lowercase alphabets, split the given string into as many substrings as possible such that each character from the given string appears… Read More
Given a string S, the task is to print the string after removing the minimum size substring such that S is a palindrome or not.… Read More
Given two strings A and B, the task is to count the minimum number of operations required to convert the string A to B. In… Read More
Given binary string str, the task is to count the total number of ways to split the given string into three non-overlapping substrings having the… Read More
Given a string S of length N containing only lowercase alphabets, the task is to print the count of substrings of the given string whose… Read More
Given a binary string S of length N and an even integer K, the task is to check if all substrings of length K contains… Read More
String matching algorithms have greatly influenced computer science and play an essential role in various real-world problems. It helps in performing time-efficient tasks in multiple… Read More
Given a string str and two integers X and Y, the task is to find the maximum cost required to remove all the substrings “pr”… Read More
Given string str, the task is to reverse the string by considering each word of the string, str as a single unit. Examples:Attention reader! Don’t… Read More
Given a binary string str of length N and an integer K where K is in the range (1 ≤ K ≤ N), the task… Read More
Given two Strings S and T of length N consisting of lowercase alphabets, which are permutations of each other, the task is to print the… Read More
Given a string str, the task is to find the minimum numbers of substrings that the given string S can be split into, such that… Read More
Given two strings str1 and str2, the task is to find the lexicographic smallest permutation of str1 that contains str2 as a substring. Note: Assume… Read More
Given a binary string of length N, we need to find out how many substrings of this string contain only 1s. Examples: Attention reader! Don’t stop… Read More
Given a string S consisting of lowercase English letters, the task is to find the length of the longest substring from the given string, having… Read More