Lexicographically largest string possible by reversing substrings having even number of 1s
Given a binary string S, the task is to convert the given string S to its lexicographic maximum form by reversing substrings having an even number of 1s....
read more
Count of same length Strings that exists lexicographically in between two given Strings
Given two string S1 and S2 of length L, the task is to count the number of strings of length L, that exists in between S1 and S2, which are lexicographically greater than S1 but smaller than S2. Examples:...
read more
Sort an Array alphabetically when each number is converted into words
Given an array arr[] containing N non-negative integers, the task is to sort these integers alphabetically when each number is converted into words....
read more
Lexicographically largest sub-sequence of the given string
Given string str containing lowercase characters, the task is to find the lexicographically largest sub-sequence of str....
read more
Lexicographically largest string possible in one swap
Given string str of length N, the task is to obtain the lexicographically largest string by at most one swap....
read more
Permutation present at the middle of lexicographic ordering of permutations of at most length N made up integers up to K
Given two positive integers K and N, the task is to find the permutation present at the middle of all permutations of at most length N, consisting of integers from the range [1, K], arranged lexicographically....
read more
Lexicographically next string
Given a string, find lexicographically next string....
read more
Lexicographically largest prime path from top-left to bottom-right in a matrix
Given a m x n matrix of positive integers. The task is to find the number of paths from the top left of the matrix to the bottom right of the matrix such that each integer in the path is prime....
read more
Lexicographically smallest string obtained after concatenating array
Given n strings, concatenate them in an order that produces the lexicographically smallest possible string....
read more
Lexicographically smallest string after M operations
Given a string S and integer M. The task is to perform exactly M operations to get lexicographical smallest string....
read more
Rearrange the characters of the string such that no two adjacent characters are consecutive English alphabets
Given string str of size N consists of lower-case English alphabets. The task is to find the arrangement of the characters of the string such that no two adjacent characters are neighbors in English alphabets. In case of multiple answers print any of them. If no such arrangement is possible then print -1.Examples:...
read more
Modify given string such that odd and even indices is lexicographically largest and smallest
Given a string S consisting of N lowercase alphabets, the task is to modify the given string by replacing all the characters with characters other than the current character such that the suffix string formed from odd and even indices is lexicographically largest and smallest respectively among all possible modifications of the string S....
read more