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....
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....
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:...
Given binary string str, the task is to check whether the given string follows the below condition or not:...
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....
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....
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:...
Given a string S, the task is to find the length of the longest substring between any pair of occurrences of same character....
Given string str, the task is to rearrange the given string to obtain the longest palindromic substring....
Given two strings str1 and str2, the task is to find the lexicographic smallest permutation of str1 that contains str2 as a 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....
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....