Given two strings S and T, the task is to merge these two strings by adding one character at a time from the beginning of… Read More

# Tag Archives: lexicographic-ordering

Given an array arr[], consisting of N distinct positive integers and an integer K, the task is to find the lexicographically smallest permutation of the… Read More

Given a string S consisting of N lowercase English characters, the task is to print the lexicographically, the largest string obtained using only the minimum… Read More

Given three numbers N, A, and X, the task is to construct the lexicographically smallest binary array of size N, containing A 0s and having… Read More

Given a string S, the task is to find the string which is lexicographically smallest and not a subsequence of the given string S. Examples:… Read More

Given a string S of length N, consisting of lowercase alphabets, the task is to find the lexicographically longest string that can be obtained by… Read More

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… Read More

Given a positive integer K, the task is to find lexicographically the smallest string that can be generated by using the first K lowercase alphabets… Read More

Given an array arr[] consisting of N integers, the task is to find the lexicographically largest permutation of the given array possible by exactly one… Read More

Given a positive integer N, the task is to find the lexicographically largest string consisting of lower-case English alphabets such that the sum of the… Read More

Given a string S consisting of N lowercase characters, the task is to find the starting and the ending indices ( 0-based indexing ) of… Read More

Given a string S of length N, the task is to find the lexicographically smallest K-length subsequence from the string S (where K < N). … Read More

Given a positive integer N, the task is to construct the lexicographically largest array of size (2 * N – 1) comprising of first N… Read More

Given an array arr[] of size N, the task is to find the lexicographically smallest permutation of the given array such that the sum of… Read More

Given an array arr[] of size N, the task is to find the lexicographically largest permutation array by reversing any suffix subarrays from the array.… Read More