Skip to content

Category Archives: Strings

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
Given a binary string S of size N, the task is to find the minimum non-negative integer which is not a subsequence of the given… Read More
Given a string, str of length N and a character X, the task is to find the maximum count of characters X that are to… Read More
Given a string str and a word w, the task is to print the number of the occurrence of the given word in the string… Read More
Given a positive integer N, the task is to maximize the integer N by rearranging the digits and check if the sum of the left… Read More
Given a string S of size N consisting of lowercase characters, the task is to find the sum of Manhattan distance between each pair (i,… 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 string S of length N, consisting of lowercase alphabets, the task is to find the lexicographically longest string that can be obtained by… Read More
Given a string, S of size N, and a number of rows R, the task is to print the given string in a vertical zigzag… Read More