Skip to content

Tag Archives: lexicographic-ordering

Given two positive integers N and K, the task is to find lexicographically the smallest permutation of first N natural numbers such that there are… Read More
Given a string S of length N and an integer K, the task is to find the frequency of the lexicographically Kth smallest character present… Read More
Given a binary string S of length N, the task is to find the lexicographic rank of the given string. Examples: Input: S = “001”Output:… Read More
Given a string S of size N and a positive integer K, the task is to perform atmost K operations on string S to make… Read More
Given two strings A and B of length M and N respectively, the task is to find the minimum swapping of two characters required to… Read More
Given an array of strings Files[], representing name of some files, the task is to sort the array based on the lexicographical order of the… Read More
Given a character array, str[] of consisting of N lowercase alphabets, and an integer array, arr[] consisting of numbers in the range [0, N –… Read More
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… Read More
Given three integers N, low and high, the task is to find the lexicographically largest bitonic sequence consisting of N elements lying in the range… Read More
Given a string S consisting of N unique lowercase alphabets and an array arr[] of length N where character S[i] represents the bulb and arr[i]… Read More
Given a string S and a character C, the task is to place a character in the string in such a way that the string… Read More
Given an integer N, the task is to print all numbers from 1 to N ( N < 100000) in words in lexicographical order. Examples… Read More
Given an integer N, the task is to count all possible strings of length N consisting of vowels {a, e, i, o, u} that can… Read More
Given a string S consisting of lowercase alphabets, the task is to find the lexicographically smallest string that can be obtained by removing duplicates from… Read More

Start Your Coding Journey Now!