Skip to content

Tag Archives: substring

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
Given a string ‘s’, the task is to check whether the string has both prefix and suffix substrings of length greater than 1 which are… Read More
Given a string S consisting of lowercase characters(a-z) only, the task is to print a new string by rearranging the string in such a way… Read More
Suppose we are given a string s1, we need to the find total number of substring(including multiple occurrences of the same substring) of s1 which… Read More
Given an integer N, the task is to print all the substring of N without doing any conversion i.e converting it into a string or… Read More
Given a string and several queries on the substrings of the given input string to check whether the substring is a palindrome or not. Examples… Read More