## Order of indices which is lexicographically smallest and sum of elements is <= X

Given an array arr[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… Read More »

- Check whether two strings contain same characters in same order
- Print a number as string of 'A' and 'B' in lexicographic order
- Lexicographically largest sub-sequence of the given string
- Implementing next_permutation() in Java with Examples
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- Make lexicographically smallest palindrome by substituting missing characters
- Order of indices which is lexicographically smallest and sum of elements is <= X
- Check if string can be made lexicographically smaller by reversing any substring
- Reorder the position of the words in alphabetical order
- Find the lexicographical next balanced bracket sequence
- Queries to answer the X-th smallest sub-string lexicographically

Given an array arr[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… Read More »

Given two strings s1 and s2, the task is to find whether the two string contain the same characters that occur in the same order.… Read More »

Given a balanced bracket sequence as a string str containing character ‘(‘ or ‘)’, the task is to find the next lexicographical order balanced sequence… Read More »

Given two arrays A and B of N integers. Reorder the elements of B in itself in such a way that the sequence formed by… Read More »

Given a string str some of whose characters are missing and are represented by a ‘*’. The task is to substitute the missing characters so… Read More »

Given a string str and Q queries. Every query consists of a number X, the task is to print the Xth lexicographically smallest sub-string of… Read More »

Given an array arr[] of strings, the task is to reorder the strings lexicographically and print their positions in the original list. Examples: Input: arr[]… Read More »

Given a string S, the task is to check if we can make the string lexicographically smaller by reversing any sub-string of the given string.… Read More »

Given an array or string, the task is to find the next lexicographically greater permutation of it in Java. Examples: Input: string = “gfg” Output:… Read More »

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 »