Skip to content

Category Archives: Strings

Given a string S consisting of N lowercase characters, the task is to modify the given string such that no subsequence of length two repeats… Read More
Given a string S consisting of N characters, the task is to check if the given string S is IPv4 or IPv6 or Invalid. If… 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 string S, the task is to find the length of the longest subsequence of the consecutive lowercase alphabets. Examples: Input: S = “acbdcfhg”Output: 3Explanation: String… Read More
Given a string S, the task is to find the string which is lexicographically smallest and not a subsequence of the given string S. Examples: Input:… Read More
Given a string s consisting of parentheses {‘(‘ and ‘)’} and integers, the task is to construct a Binary Tree from it and print its… Read More
Given a binary string S consisting of N characters, the task is to print the minimum number of operations required to remove all the characters… Read More
Given a number N, the task is to check if for every value of i (0 <= i <= len), the first i digits of… 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 string S consisting of N characters, the task is to print all palindromic strings of length 3 in lexicographical order that can be… Read More
Given a string S consisting of N lowercase characters, the task is to find the length of the longest substring consisting of an even number… Read More
Given two strings X and Y consisting of N and M characters, the task is to find the longest subsequence of a string X which… Read More
Given 2 array of strings X and Y, the task is to find the number of superstrings in X. A string s is said to… Read More