## Replace two substrings (of a string) with each other

Given 3 strings S, A and B. The task is to replace every sub-string of S equal to A with B and every sub-string of… Read More »

## Count the number of common divisors of the given strings

Given two strings a and b, the task is to count the number of common divisors of both the strings. A string s is a… Read More »

## Maximum count of sub-strings of length K consisting of same characters

Given a string str and an integer k. The task is to count the occurrences of sub-strings of length k that consist of the same… Read More »

## Count distinct substrings that contain some characters at most k times

Given a integer k and a sting str, the task is to count the number of distinct sub-strings such that each sub-string does not contain… Read More »

## Minimum K such that every substring of length atleast K contains a character c

Given a string S containing lowercase latin letters. A character c is called K-amazing if every substring of S with length atleast K contains this… Read More »

## Python | Finding strings with given substring in list

The classical problem that can be handled quite easily by Python and has been also dealt with many times is finding if a string is… Read More »

## Substring Reverse Pattern

Given a string str, the task is to print the pattern given in the examples below: Examples: Input: str = “geeks” Output: geeks *kee* **e**… Read More »

## Python program to print the substrings that are prefix of the given string

Given a string, print all the possible substrings which are also the prefix of the given string. Examples: Input : ababc Output : a, ab,… Read More »

## Sub-strings of a string that are prefix of the same string

Given a string str, the task is to count all possible sub-strings of the given string that are prefix of the same string. Examples: Input:… Read More »

## Number of sub-strings which are anagram of any sub-string of another string

Given two strings S1 and S2, the task is to count the number of sub-strings of S1 that are anagrams of any sub-string of S2.… Read More »

## String which when repeated exactly K times gives a permutation of S

Given an integer K and a string str of lowercase English characters, the task is to find a string s such that when s is… Read More »

## Find the count of substrings in alphabetic order

Given a string of length consisting of lowercase alphabets. The task is to find the number of such substrings whose characters occur in alphabetical order.… Read More »

## Find the count of palindromic sub-string of a string in its sorted form

Given a string str consisting of lowercase English alphabets, the task is to find the total number of palindromic sub-strings present in the sorted form… Read More »

## Count the number of vowels occurring in all the substrings of given string

Given a string of length N of lowercase characters containing 0 or more vowels, the task is to find the count of vowels occurred in… Read More »

## Minimum steps to remove substring 010 from a binary string

Given a binary string, the task is to count the minimum steps to remove substring “010” from this binary string. Examples: Input: binary_string = “0101010”… Read More »