Given a string consisting of numerical alphabets, a character C and an integer K, the task is to find the number of possible substrings which… Read More

# Tag Archives: substring

Given a string str and an integer K, the task is to find the length of the longest sub-string S’ such that every character in… Read More

Given a string str, the task is to answer Q queries where every query consists of two integers L and R and we have to… Read More

Given a string S of length N consisting of lower-case English alphabets and an integer ‘l’, find the number of distinct substrings of length ‘l’… Read More

Given a string str, the task is to count the number of ways a palindromic sub-string could be formed by concatenation of three sub-strings x,… Read More

Given two strings A, B and some queries consisting of an integer i, the task is to check whether the sub-string of A starting from… Read More

Given two binary strings s and t. The task is to rearrange the string s in such a way that the occurrence of string t… Read More

Given a binary string str, the task is to find the maximum length of the sub-string of str that has odd parity. A binary string… Read More

Given a string str, the task is to answer Q queries where every query consists of two integers L and R and we have to… Read More

Given a string str, the task is to check whether the string contains two non-overlapping sub-strings s1 = “geek” and s2 = “keeg” such that… Read More

Given a string str of lowercase alphabets, the task is to find all distinct palindromic sub-strings of the given string. Examples: Input: str = “abaaa” Output:… Read More

Given a binary string str. The task is to find the smallest positive integer C such that the binary string can be cut into C… Read More

Given three strings str, A and B. The task is to check whether str = A + B or str = B + A where… Read More

Given a string of lowercase, find the length of the longest substring that does not contain any palindrome as a substring. Examples: Input : str… Read More

Given a binary string str. For n-contiguous 1s the score is updated as score = score + n2 and for n-contiguous 0s, the score is… Read More