## Check if words are sorted according to new order of alphabets

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 »

- Print all the combinations of a string in lexicographical order
- Lexicographically largest prime path from top-left to bottom-right in a matrix
- Check if words are sorted according to new order of alphabets
- Lexicographically smallest string formed by removing at most one character
- Find a string such that every character is lexicographically greater than its immediate next character
- K-th lexicographically smallest unique substring of a given string
- Lexicographically smallest permutation with no digits at Original Index
- Arrange a binary string to get maximum value within a range of indices
- Lexicographically Smallest Permutation of length N such that for exactly K indices, a[i] > a[i] + 1
- Lexicographically middle string

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 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… 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 »

Given a string s we have to find the lexicographical maximum substring of a string Examples: Input : s = “ababaa” Output : babaa Explanation… Read More »

Given n strings, concatenate them in an order that produces the lexicographically smallest possible string. Examples: Input : a[] = [“c”, “cb”, “cba”] Output :… Read More »