Skip to content

Tag Archives: lexicographic-ordering

Given an integer N, the task is to print all numbers up to N in Lexicographical order. Examples:  Input: N = 15 Output: 1 10 11 12… Read More
Given string str containing only the lowercase English alphabet and an integer K, the task is to find a K length substring that contains the… Read More
Given an array A[] of length N, the task is to find lexicographically smallest array by swapping adjacent elements for each index atmost once. Thus,… Read More
Given two integers N and K, the task is to find lexicographically Kth string of length N. If the number of possible strings of length… Read More
Given a string S, the task is to find the largest lexicographical string with no more than K consecutive occurrence of an element by either… Read More
Given a palindromic string str containing only lowercase letters, the task is to print the lexicographically smallest string, by replacing exactly one character, such the… Read More
Given two numbers N and K, the task is to find the Kth string in lexicographical order if the starting string contains (N-2) x’s first… Read More
Given an array arr[] containing N non-negative integers, the task is to sort these integers alphabetically when each number is converted into words. Examples:   Input:… Read More
Given a string s of size N. The task is to find lexicographically all the shortest palindromic substrings from the given string. Examples: Input: s=… Read More
Given a string str, the task is to sort the string according to the frequency of each character, in ascending order. If two elements have… Read More
Given a string of size N and some queries, the task is to find the lexicographically smallest palindromic subsequence of even length in range [L,… Read More
Given two strings A and B of all uppercase letters, the task is to find whether is it possible to make string A strictly lexicographically… Read More
Given two string S1 and S2 of length L, the task is to count the number of strings of length L, that exists in between… Read More
Two players are playing a game where a string str is given. The first player can take the characters at even indices and the second… Read More
Given two integers N and K. The task is to print the lexicographically smallest string of length N consisting of lower-case English alphabets such that… Read More

Start Your Coding Journey Now!