Minimum removal of consecutive similar characters required to empty a Binary String
Given a binary string S of length N, the task is to find the minimum number of removal of adjacent similar characters required to empty the given binary string....
read more
Minimum length substring with exactly K distinct characters
Given a string S and a number K. The task is to find the minimum length substring having exactly K distinct characters. Note: The string S consists of only lowercase English alphabets....
read more
Count substrings that contain all vowels | SET 2
Given a string str containing lowercase alphabets, the task is to count the sub-strings that contain all the vowels at-least one time and there are no consonants (non-vowel characters) present in the sub-strings. Examples:...
read more
Check if given Binary string follows then given condition or not
Given binary string str, the task is to check whether the given string follows the below condition or not:...
read more
Minimum length of substring whose rotation generates a palindromic substring
Given a string str, the task is to find the minimum length of substring required to rotate that generates a palindromic substring from the given string....
read more
Create List of Substrings from List of Strings in Python
In Python, when we work with lists of words or phrases, we often need to break them into smaller pieces, called substrings. A substring is a contiguous sequence of characters within a string. Creating a new list of substrings from a list of strings can be a common task in various applications. In this article, we will create a new list of substrings from a list of strings....
read more
Count all substrings having character K
Given a string str and a character K, the task is to find the count of all the substrings of str that contain the character K.Examples:...
read more
Longest substring between any pair of occurrences ōf similar characters
Given a string S, the task is to find the length of the longest substring between any pair of occurrences of same character....
read more
Rearrange string to obtain Longest Palindromic Substring
Given string str, the task is to rearrange the given string to obtain the longest palindromic substring....
read more
Lexicographic smallest permutation of a String containing the second String as a Substring
Given two strings str1 and str2, the task is to find the lexicographic smallest permutation of str1 that contains str2 as a substring....
read more
Maximized partitions of a string such that each character of the string appears in one substring
Given a string S, split the given string into as many substrings as possible such that each character from the given string appears in a single substring and print all these possible parts. The task is to print those substrings....
read more
Lexicographically smallest K-length substring containing maximum number of vowels
Given string str containing only the lowercase English alphabet and an integer K, the task is to find a K length substring that contains the maximum number of vowels (i.e. ‘a’, ‘e’, ‘i’, ‘o’, ‘u’). If there are multiple such substrings, return the substring which is lexicographically smallest....
read more