Skip to content

Category Archives: Strings

Given a binary string S of length N, the task is to find the lexicographic rank of the given string. Examples: Input: S = “001”Output:… Read More
Given a string S, the task is to move all the digits present in the string, to the beginning of the string. Examples: Input: S… Read More
Given a string S, the task is to find and extract all the URLs from the string. If no URL is present in the string,… Read More
Given a Binary Tree with each node representing an alphabet, the task is to find lexicographically smallest palindromic root to leaf path. If no palindromic… Read More
Given a string str, the task is to split the string into maximum number of unique substrings possible and print their count. Examples:   Input: str… Read More
Given two strings A and B of length N and M respectively and an array arr[] consisting of K integers, the task is to check… Read More
Given two arrays of strings arr[] and brr[] of size N and M respectively, the task is to find the winner of the game when… Read More
Given a string str, the task is to find all the duplicate characters present in a given string in lexicographical order without using any additional… Read More
Given a binary string S of length N, the task is to find the minimum number of characters required to be inserted such that all… Read More
Given a binary string S, the task is to find the minimum count of flips required to modify a string such that it does not… Read More
Given two strings A and B, the task is to count the minimum number of operations required to construct the string B by following operations:  … Read More
Given a string S of length N and an array Q[][] of dimension M × 3 consisting of queries of type {L, R, C}, the… Read More
Given an array arr[] consisting of N integers, and an integer K, the task is to construct a binary string of length K satisfying the… Read More
Given a binary string str of even length, consisting of equal number of 0s and 1s, the task is to segregate all 1s and 0s… Read More
Given a string S representing an email address of length N, the task is to find the minimum possible length of the string by replacing… Read More