Skip to content

Tag Archives: substring

Given a balanced parentheses string which consists of ‘(‘ and ‘)‘. The task is to find the number of balanced parentheses substrings in the given… Read More
Given binary string S of size N and a number K. The task is to find the Longest sub string of 0’s in the string… Read More
Given a string S and a character K. The task is to find the length of the longest substring of S having all characters the… Read More
Given a string str and a character ch, the task is to find the longest palindromic sub-string of str such that it starts and ends… Read More
Given binary string str, the task is to find the count of non-overlapping sub-strings of either the form “010” or “101”. Examples:  Input: str =… Read More
Given a string str, the task is to find the count of distinct characters in all the distinct sub-strings of the given string.Examples:   Input: str… Read More
Given a string str containing lowercase alphabets, the task is to count the sub-strings that contain all the vowels at-least one time and there are… Read More
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
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

Start Your Coding Journey Now!