Skip to content

Category Archives: Strings

Given a string S consisting of N lowercase alphabets, the task is to remove the characters from the string whose frequency is not a power… Read More
Given a string S of length N and a 2D array of strings Q[][] consisting of M queries of the following type: Query(“U”, “I”, “X”):… Read More
Given a string S of length N, the task is to find the minimum number of characters required to be removed such that every distinct… Read More
Given two strings A and B of lengths N and M respectively, the task is to find the length of the longest common subsequence that… Read More
Given a binary string S and two positive integers A and B, the task is to check if the string consists of A independent pair… Read More
Given a string S consisting of lowercase alphabets, the task is to check whether the given string can be rearranged such that the string can… Read More
Given a binary string S and an array A[], both of size N, the task is to find the maximum score possible by removing substrings… Read More
Given a string S representing a time in 24 hours format, with ‘_’ placed at positions of some digits, the task is to find the… Read More
Given two strings text and pattern of length M and N respectively, the task is to check if the pattern matches the text or not.… Read More
Given a string S and an array of strings arr[] of length N and M respectively, the task is to find the string from the… Read More
Given a string S, the task is to find the minimum removal of characters required such that the string S consists only of two alternating… Read More
For any given character, we need to check if it is a vowel or a consonant. As we know, vowels are ‘a’, ‘e’, ‘i’, ‘o’,… Read More
Given an array of strings arr[] consisting of lowercase and uppercase characters only, the task is to modify the array by removing the characters from… Read More
Given a string S, representing a line in a program, the task is to check if the given string is a comment or not.  Types… Read More
Given a string S of length N, representing a sentence, the task is to print the words with the highest and lowest average of ASCII… Read More