Skip to content

Tag Archives: lexicographic-ordering

Given a string S, the task is to find out the length of the smallest substring of S that needs to be rearranged so that… Read More
Given two strings str1 and str2 containing lowercase letters. The task is to convert the given string str3 into lexicographically smallest and largest string that… Read More
Given an array A[] of N integers, the task is to find the lexicographically smallest subsequence of the array by deleting all the occurrences of… Read More
Given an array A[] of size N, find the permutation of array A such that the array B[] which is formed by taking the GCD… Read More
Given two strings X and Y of lowercase letters, of length N and M respectively, the task is to build another string Z by performing… Read More
Given a string S of size N, having lowercase alphabets, the task is to find the lexicographically minimum string after moving a subsequence to the… Read More
Given string str of size N and two integers M and K (N is divisible by M), the task is to find the Kth non-overlapping… Read More
Given a 2D array arr[] having N rows of variable size, the task is to sort the array in lexicographical order i.e., sort each row… Read More
Given two integers N and M, the task is to find the Mth lexicographically smallest binary string (have only characters 1 and 0) of length… Read More
Given a binary string s of length N, the task is to find the lexicographically smallest string using infinite number of swaps between 0’s and… Read More
Given three strings, ‘X‘, ‘Y‘ and ‘Z‘, the task is to count the number of subsequences of ‘X‘ which is lexicographically greater than or equal… Read More
Given an array arr[] of size N which is a permutation from 1 to N, the task is to find the lexicographically smallest permutation that… Read More
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… Read More
Given a sentence S and a string B having distinct characters, find a string by joining the words of S according to given conditions:- Choose… Read More
Given two integers N and K, the task is to form a string of size N using the first K characters of the alphabet following… Read More

Start Your Coding Journey Now!