## Generate all binary strings of length n with sub-string “01” appearing exactly twice

Given an integer N, the task is to generate all possible binary strings of length N which contain “01” as the sub-string exactly twice. Examples:… Read More »

- Minimum length substring with exactly K distinct characters
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Count substrings that contain all vowels | SET 2
- Count of substrings which contains a given character K times
- Number of sub-strings that contain the given character exactly k times
- Queries to find the first non-repeating character in the sub-string of a string
- Maximum length palindromic substring such that it starts and ends with given char
- Queries to check if string B exists as substring in string A
- Minimum number of sub-strings of a string such that all are power of 5
- Maximum count of sub-strings of length K consisting of same characters
- Count number of distinct substrings of a given length
- Length of the longest substring that do not contain any palindrome
- Length of the longest substring with no consecutive same letters
- Queries to find the last non-repeating character in the sub-string of a given string
- Replace two substrings (of a string) with each other
- Check if the given string is K-periodic
- Count of non-overlapping sub-strings "101" and "010" in the given binary string
- Find distinct characters in distinct substrings of a string
- Longest substring of only 4's from the first N characters of the infinite string
- Find the count of sub-strings whose characters can be rearranged to form the given word
- Count the number of common divisors of the given strings
- Count of sub-strings that do not contain all the characters from the set {'a', 'b', 'c'} at the same time
- Rearrange given string to maximize the occurrence of string t
- Minimum length of the sub-string whose characters can be used to form a palindrome of length K
- Check if string can be made lexicographically smaller by reversing any substring
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- Number of ways in which the substring in range [L, R] can be formed using characters out of the range
- Count of sub-strings that do not consist of the given character
- Count of sub-strings that contain character X at least once

Given an integer N, the task is to generate all possible binary strings of length N which contain “01” as the sub-string exactly twice. Examples:… Read More »

Given a string str consisting only of the characters ‘a’, ‘b’ and ‘c’, find the number of sub-strings that do not contain all the three… Read More »

Given a string S and a range [L, R]. The task is to find the number of ways in which the sub-string in the range… Read More »

Every state is represented by string of length 2. For example DL is used for Delhi, HP for Himachal Pradesh, UP for Uttar Pradesh, PB… Read More »

Given a string str and an integer K, the task is to check whether the given string is K-periodic. A string is k-periodic if the… Read More »

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… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »