## Lexicographical Maximum substring of string

Given a string s we have to find the lexicographical maximum substring of a string Examples: Input : s = “ababaa” Output : babaa Explanation… 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 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 »

Given an array arr[], find the lexicographically largest array that can be obtained by performing at-most k consecutive swaps. Examples : Input : arr[] =… Read More »

Given a number K and a string S, We have to Find the lexicographically smallest string str of length K such that it’s set of… Read More »

Given a string, find concatenation of all substrings in lexicographic order. Examples: Input : s = “abc” Output : aababcbbcc The substrings of s in… Read More »

Given a string S. Print the lexicographically smallest string possible. You can make minimal changes to the characters in the string and you can permute… Read More »

Given two strings S and T, find a string of the same length which is lexicographically greater than S and smaller than T. Print “-1”… Read More »

Given a strings, we need to sort the words in lexicographical order (dictionary order). Examples : Input : “hello python program how are you” Output… Read More »

Given a string of lowercase alphabets. Some of characters of given string got corrupted and are now represented by *. We can replace * with… Read More »

Given an array of n positive integers such that each element of integer is from 1 to n. Find the lexicographically permutation that can be… Read More »

Given a string, find lexicographically next string. Examples: Input : geeks Output : geekt The last character ‘s’ is changed to ‘t’. Input : raavz… Read More »

Given a lowercase string A of length N and an integer K, find the lexicographically smallest string B of the same length as A such… Read More »

Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in… Read More »

In this article, we will discuss how we can compare to strings lexicographically in Java. One solution is to use Java compareTo() method. The method… Read More »

Given a string str. The problem is to rearrange characters of the given string such that the vowels and consonants occupy alternate position and the… Read More »