Skip to content

Tag Archives: substring

Given two strings X and Y of length N, the task is to check if both the strings can be made equal by reversing any… Read More
Given two strings str1 and str2, the task is to count the maximum consecutive occurrences of the string str2 in the string str1. Examples: Input:… Read More
Given a binary string str of size N, the task is to minimize the length of given binary string by removing even length substrings consisting… Read More
Given two strings S and T, the task is to count the number of substrings of S that contains string T in it as a… Read More
Given a string str, the task is to find the maximum count of common non-repeating characters that can be obtained by partitioning the given string… Read More
Given a binary string S of length N, the task is to find the longest substring consisting of ‘1’s only present in the string after… Read More
Given two strings, str1 and str2 of length N, the task is to convert the string str1 to string str2 by selecting a substring and… Read More
Given string str consisting of lowercase letters, the task is to find the maximum number of non-overlapping substrings such that each substring contains all occurrences… Read More
Given two strings S and T of length N and M respectively, the task is to count the number of ways of obtaining same-length substring… Read More
Content has been removed on Author’s request. Recommended Solve DSA problems on GfG Practice. Solve Problems My Personal Notes arrow_drop_up Save
Given numerical string str consisting of N integers, the task is to find the sum of all possible resulting strings after removing non-empty substrings. Examples:… Read More
Given a string S of valid parentheses “(“ and “)”, the task is to print the string obtained by removing the outermost parentheses of every… Read More
Given a string str of length N and a substring pattern of length M, the task is to find the frequency of occurrences of pattern… Read More
Given a binary string S of length N, the task is to find the minimum number of removal of adjacent similar characters required to empty… Read More
Given an array of strings arr[], the task is to find the pair of strings from the given array whose length of the longest common… Read More

Start Your Coding Journey Now!