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....
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:...
Given an array arr[] containing N non-negative integers, the task is to sort these integers alphabetically when each number is converted into words....
Given string str containing lowercase characters, the task is to find the lexicographically largest sub-sequence of str....
Given string str of length N, the task is to obtain the lexicographically largest string by at most one swap....
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....
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....
Given n strings, concatenate them in an order that produces the lexicographically smallest possible string....
Given a string S and integer M. The task is to perform exactly M operations to get lexicographical smallest string....
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:...
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....