Skip to content

Category Archives: Strings

Given two binary strings A and B of length N, the task is to convert the string A to B by repeatedly flipping a prefix… Read More
Given two sorted strings S1 and S2 of lengths N and M respectively, the task is to construct lexicographically the smallest string possible by merging… Read More
Given a string S of size N, the task is to sort the string without changing the position of vowels. Examples: Input: S = “geeksforgeeks”Output:… Read More
Given a string keyboardLayout of size 26 representing the sequence of characters present in a single row of a keyboard and a string word, the… Read More
Given two strings S1, S2 of length N and M respectively, and two positive integers N1 and N2, the task is to find the maximum… Read More
Given a string S consisting of N lowercase alphabets, the task is to find the length of the smallest substring in S whose occurrence is… Read More
Given a string S consisting of lowercase English alphabets, the task is to find the number of unique characters present in the string. Examples: Input:… Read More
Given two strings str and X of length N and M respectively, the task is to find the minimum characters required to be removed from… Read More
Given a positive integer N, the task is to print the nearest power of 2 of the frequencies of each digit present in N. If… Read More
Given two strings S and T of length N and M respectively, the task is to find the smallest string that is divisible by both… Read More
Given a string S consisting of characters 0, 1, and ‘?’, the task is to count all possible combinations of the binary string formed by… Read More
Given circular binary string S of size N, the task is to count the minimum number of consecutive 0s required to be removed such that… Read More
Given an integer N and a binary string consisting of 4*N number of 0s initially, the task is to flip the characters such that any… Read More
Given a binary string S, the task is to find the minimum number of characters required to be removed from S, such that all the… Read More
Given two binary strings S1 and S2 of size N and M respectively, the task is to find the minimum number of reversal of substrings… Read More