Print all distinct circular strings of length M in lexicographical order
Given a string and an integer M, print all distinct circular strings of length M in lexicographical order. Examples: Input: str = “baaaa”, M =… Read More »
Given a string and an integer M, print all distinct circular strings of length M in lexicographical order. Examples: Input: str = “baaaa”, M =… Read More »
Given a coordinate (x, y) on a 2D plane. We have to reach (x, y) from the current position which is at origin i.e (0,… Read More »
Given a string s we have to find the lexicographical maximum substring of a string Examples: Input : s = “ababaa” Output : babaa Explanation… Read More »
Given n strings, concatenate them in an order that produces the lexicographically smallest possible string. Examples: Input : a[] = [“c”, “cb”, “cba”] Output :… Read More »
Given an array arr[], find the lexicographically largest array that can be obtained by performing at-most k consecutive swaps. Examples : Input : arr[] =… Read More »
Given a number K and a string S, We have to Find the lexicographically smallest string str of length K such that it’s set of… Read More »
Given a string, find concatenation of all substrings in lexicographic order. Examples: Input : s = “abc” Output : aababcbbcc The substrings of s in… Read More »
Given a string S. Print the lexicographically smallest string possible. You can make minimal changes to the characters in the string and you can permute… Read More »
Given two strings S and T, find a string of the same length which is lexicographically greater than S and smaller than T. Print “-1”… Read More »
Given a strings, we need to sort the words in lexicographical order (dictionary order). Examples : Input : “hello python program how are you” Output… Read More »
Given a string of lowercase alphabets. Some of characters of given string got corrupted and are now represented by *. We can replace * with… Read More »
Given an array of n positive integers such that each element of integer is from 1 to n. Find the lexicographically permutation that can be… Read More »
Given a string, find lexicographically next string. Examples: Input : geeks Output : geekt The last character ‘s’ is changed to ‘t’. Input : raavz… Read More »
Given a lowercase string A of length N and an integer K, find the lexicographically smallest string B of the same length as A such… Read More »
Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in… Read More »