Skip to content

Category Archives: Strings

Given a string S of length N, the task is to count the number of anagrams of S whose first character is a consonant and… Read More
Given a string S of length N, the task is to sort the vowels of the given string in alphabetical order at place them accordingly… Read More
Given string str of length N, consisting of pairs of balanced parentheses, the task is to calculate the score of the given string based on… Read More
Given a string S of length N consisting of 1, 0, and X, the task is to print the character (‘1’ or ‘0’) with the… Read More
Given a string S of length N and two integers M and K, the task is to count the number of substrings of length M… Read More
Given a number N, the task is to count the minimum number of digits to be removed from N to make it divisible by 4.… Read More
Given two integers A and C, the task is to check if there exists a permutation of the number A such that the sum of… Read More
Given an array arr[] consisting of N integers, the task is to find the expression by using parenthesis ‘(‘ and ‘)’ and division operator ‘/’… Read More
Given a string S, the task for every index of the string is to find the length of the longest palindromic substring that either starts… Read More
Given a string S of length N consisting of lowercase English alphabets and ‘?’, the task is to check if it is possible to make… Read More
Given a binary string str of size N, the task is to find the length of the smallest subsequence such that after erasing the subsequence… Read More
Given a string S consisting of lowercase alphabets and an integer K, the task is to print all the words that occur K times in… Read More
Given a string S of length N, the task is to find the lexicographically smallest K-length subsequence from the string S (where K < N). … Read More
Given a string S, the task is to check if the string can be split into two substrings such that the number of vowels in… Read More
Given a string S of lowercase English alphabets, the task is to print the smallest word in the given string. Examples: Input: S = “sky… Read More