## Lexicographically smallest string of length N and sum K

Given two integers N and K. The task is to print the lexicographically smallest string of length N consisting of lower-case English alphabates such that… 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
- 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
- Lexicographically smallest string formed by appending a character from first K characters of a string | Set 2
- 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
- Find the lexicographical next balanced bracket sequence
- Lexicographical smallest alternate Array
- 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
- Lexicographically smallest string of length N and sum K

Given two integers N and K. The task is to print the lexicographically smallest string of length N consisting of lower-case English alphabates such that… Read More »

Given an array arr[] of distinct elements, the task is to rearrange the array such that it is lexicographically smallest and of the form arr[0]… Read More »

Given a string str consisting of lowercase alphabets and an integer K, you can perform the following operations on str Initialize an empty string X… Read More »

Given an array of N integers. The task is to find the lexicographically smallest array possible by applying the given operation any number of times.… Read More »

Given a string S of size N and Q queries. Every query consists of L and R ( 0 < = L < = R… Read More »

Given string str of size N consists of lower-case English alphabets. The task is to find the arrangement of the characters of the string such… Read More »

Given a string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the… Read More »

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 »