## Print a number as string of ‘A’ and ‘B’ in lexicographic order

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

- Check whether two strings contain same characters in same order
- Implementing next_permutation() in Java with Examples
- Rearrange the characters of the string such that no two adjacent characters are consecutive English alphabets
- Print a number as string of 'A' and 'B' in lexicographic order
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- Check if string can be made lexicographically smaller by reversing any substring
- Swap all occurrences of two characters to get lexicographically smallest string
- Make lexicographically smallest palindrome by substituting missing characters
- Reorder the position of the words in alphabetical order
- Order of indices which is lexicographically smallest and sum of elements is <= X
- Print the lexicographically smallest array by swapping elements whose sum is odd
- Lexicographically smallest string formed by appending a character from first K characters of a string | Set 2
- Find the lexicographical next balanced bracket sequence
- Queries to answer the X-th smallest sub-string lexicographically
- Queries to print the character that occurs the maximum number of times in a given range
- Lexicographical smallest alternate Array

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