Skip to content

Tag Archives: lexicographic-ordering

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 string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the first… 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 substring 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: ggf… Read More

Start Your Coding Journey Now!