Skip to content

Tag Archives: substring

Given string str, the task is to print the pattern given in the examples below: Examples:   Input: str = “geeks” Output: geeks *kee* **e** The reverse of “geeks” is “skeeg” Replace… 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
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.Examples:  … Read More
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
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. Minimum… Read More
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
Given a string of length N of lowercase characters containing 0 or more vowels, the task is to find the count of vowels that occurred… Read More
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” Output: 2 Switching… Read More
S is string containing only lowercase English alphabets. We need to find if there exists at least one palindromic sub-string whose length is even.  Examples: … Read More
Given a string ‘str’, two integers ‘k’ and ‘p’. The task is to count all the sub-strings of ‘str’ having exactly ‘k’ characters that have… Read More
Given a string ‘S’ (composed of digits) and an integer ‘X”, the task is to count all the sub-strings of ‘S’ that satisfy the following… Read More
Given a string ‘s’ check if all of its palindromic sub-strings are of odd length or not. If yes then print “YES” or “NO” otherwise.… Read More
Given a string S. The task is to print the K-th lexicographically the smallest one among the different substrings of s.A substring of s is… Read More
Given a string ‘str’ and an integer ‘k’, the task is to count the number of sub-strings of length ‘k’ which are comprised of the… Read More

Start Your Coding Journey Now!