Skip to content

Tag Archives: substring

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
Given a binary string S of size N, the task is to find the maximum number of operations that can be performed on S, by… Read More
Given a numeric string S consisting of N digits and a positive integer K, the task is to check if the given string can be… Read More
Given a string S consisting of N lowercase characters, the task is to find the length of the longest substring that does not contain any… Read More
Given a numeric string S, the task is to find the number of ways to partition a string into substrings consisting of digits in increasing… Read More
Given a binary string of size N, the task is to count the number of alternating substrings that are present in the string S. Examples: … Read More