Skip to content

Tag Archives: substring

Given a string S consisting of N characters, the task is to check if this string has an reversible equal substring from the start and… Read More
Given a string S and an array of equal length words (strings) arr[]. The task is to find the minimum start index of the substring… Read More
Given a binary string, the task is to print the length of the longest substring containing only ‘1’. Examples: Input: 110Output: 2Explanation: Length of the… Read More
Given a string S, the task is to find the lexicographically shortest string of length less than or equal to K which is not a… Read More
Given a binary string S, the task is to find the maximum length of substrings required to be flipped repeatedly to make all the characters… Read More
Given a string S consisting of N lowercase characters and character ‘?’ and a positive integer K, the task is to replace each character ‘?’… Read More
Given a binary string s, the task is to calculate the number of such substrings where the count of 1‘s is strictly greater than the… Read More
Given three strings S, S1, and S2 consisting of N, M, and K characters respectively, the task is to modify the string S by replacing… Read More
Given two positive integers X and Y and two numeric strings S and P of length N and 2 respectively, the task is to find… Read More
Given a string S size of N consisting of characters ‘a‘, ‘b‘, and ‘c‘ only, the task is to check if the given string can… Read More
Given a binary string S of length N, the task is to find lexicographically the smallest string formed after modifying the string by selecting any… Read More
Given a string S consisting of N lowercase English alphabets, and also given that a character C is called K-amazing, if every substring of length… Read More
Given two binary strings S and T of length N and a positive integer K. Initially, all characters of T are ‘0’. The task is… Read More
Given a binary string S, the task is to find the minimum number of repetitive replacements of substring “01” to string “110” such that there… Read More
Given two strings S and W of sizes N and M respectively, the task is to remove the last occurrence of W from S. If… Read More