Skip to content

Tag Archives: lexicographic-ordering

Given two strings str1 and str2 of same length N, the task is to check if there exists any permutation possible in any of the… Read More
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… Read More
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… Read More
Given a binary string S(1-based indexing) of size N, and two positive integers K1 and K2, the task is to find the lexicographically smallest string… Read More
Given an array arr[] consisting of N strings and a string S if size M, the task is to find the lexicographically smallest string consisting… Read More
Given a binary string S of size (N – 1), the task is to find the lexicographically smallest permutation P of the first N natural… Read More
Given a string S, the task is to find the lexicographically largest subsequence that can be formed using all distinct characters only once from the… Read More
Given two strings S and T, S being lexicographically greater than T, the task is to generate a lexicographically increasing sequence of strings starting from… Read More
Given a string S, the task is to find the lexicographically shortest string of length less than or equal to K which is not a… Read More
Given a string S consisting of N lowercase characters and character ‘?’ and a positive integer K, the task is to replace each character ‘?’… Read More
Given two strings S1 and S2 consisting of N and M lowercase characters, the task is to construct the lexicographically largest string by repeatedly appending… Read More
Given a binary string S of length N, the task is to find lexicographically the smallest string formed after modifying the string by selecting any… Read More
Given a graph, G consisting of N nodes, a source S, and an array Edges[][2] of type {u, v} that denotes that there is an… Read More
Given string S and a positive integer K, the task is to find lexicographically the largest possible string using at most K swaps with the… Read More
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