Given a number N, the task is to print the string of ‘A’ and ‘B’ corresponding to that number.If we represent all numbers as a string of ‘A’ and ‘B’ as follows,...
Given a string S and an integer K, the task is to find the lexicographically smallest string possible after reversing any substring of any length exactly K times....
Given a string S and a character C, the task is to place a character in the string in such a way that the string obtained is the lexicographically smallest string....
Given a strings, we need to sort the words in lexicographical order (dictionary order). Examples :...
Given an array arr[] of strings, the task is to reorder the strings lexicographically and print their positions in the original list....
Given string str containing only the lowercase English alphabet and an integer K, the task is to find a K length substring that contains the maximum number of vowels (i.e. ‘a’, ‘e’, ‘i’, ‘o’, ‘u’). If there are multiple such substrings, return the substring which is lexicographically smallest....
Given an integer K and an array arr[] having N pairwise distinct integers in the range [1, K], the task is to find the lexicographically smallest permutation of the first K positive integers such that the given array arr[] is a subsequence of the permutation....
Given two integers N and K, the task is to find lexicographically Kth string of length N. If the number of possible strings of length N is less than K, print -1.Examples:...
Given a string, print all permutations of it in sorted order. For example, if the input string is “ABC”, then output should be “ABC, ACB, BAC, BCA, CAB, CBA”....
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDADInput Constraint: 1 < n < 1000 Examples:...
Given a string S consisting of only lowercase letters, the task is to find the lexicographically largest string that can be obtained by removing K characters from the given string....
Given two strings A and B of all uppercase letters, the task is to find whether is it possible to make string A strictly lexicographically smaller than string B by swapping at most one pair of characters in A.Examples:...