Skip to content

Tag Archives: substring

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
Given a binary string S, and two integers A, which denotes the cost of reversing a substring, and B, which denotes the cost of flipping… Read More
Given a string S of size N consisting of lowercase alphabets, the task is to print the length of the longest substring consisting only of… Read More
Given three strings S, X, and Y consisting of N, A, and B characters respectively, the task is to find the number of occurrences of… Read More
Given a positive integer K, the task is to find lexicographically the smallest string that can be generated by using the first K lowercase alphabets… Read More
Given string S consists of lowercase and uppercase letters, the task is to find the number of substrings having an equal number of lowercase and… Read More
Given a numeric string S consisting of N digits, the task is to find the minimum length of the string that can be formed by… Read More
Given a string S and integers P and Q, which denotes the cost of removal of substrings “ab” and “ba” respectively from S, the task… Read More
Given a string S consisting of N lowercase characters, the task is to find the starting and the ending indices ( 0-based indexing ) of… Read More
Given a string S consisting of N lowercase alphabets, the task is to count the number of substrings whose frequency of each character is even.… Read More