# Tag Archives: lexicographic-ordering

Given a number N, the task is to print the string of ‘A’ and ‘B’ corresponding to that number.If we represent all numbers as a… Read More
Given a string str containing lowercase characters, the task is to find the lexicographically largest sub-sequence of str.Examples:   Input: str = “abc” Output: c All possible sub-sequences… Read More
Given a sequence of Words and the Order of the alphabet. The order of the alphabet is some permutation of lowercase letters. The task is… Read More
Given two integers N and K, the task is to generate a permutation of N numbers (Every number from 1 to N occurs exactly once)… Read More
Given an integer N. The task is to find the lexicographically smallest permutation of integer of the form: 12345…N such that no digit occurs at… Read More
Given a string str, the task is to find the lexicographically smallest string that can be formed by removing at most one character from the… Read More
Given a string S. The task is to print the K-th lexicographically the smallest one among the different substrings of s.A substring of s is… Read More
Given a string consisting of only 0’s and 1’s. Now you are given N non-intersecting ranges L, R ( L <= R), more specifically [L1,… Read More
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… Read More
Given a string str, print of all the combinations of a string in lexicographical order.Examples:   Input: str = "ABC" Output: A AB ABC AC ACB… Read More
Given two strings a and b. Our task is to print any string which is greater than a(lexicographically) but smaller than b(lexicographically). If it is… Read More
Given an integer N, the task is to find a string(considering only lowercase characters) of length (N+1) such that the character at any position should… Read More
Given a string S consisting of lowercase alphabets. The task is to find the lexicographically smallest string X of the same length only that can… Read More
Given a string and an integer M, print all distinct circular strings of length M in lexicographical order.  Examples:  Input: str = “baaaa”, M =… Read More
Given a coordinate (x, y) on a 2D plane. We have to reach (x, y) from the current position which is at origin i.e (0,… Read More