## Find Lexicographically smallest or largest substring of size k

Given a string and number k, write a program to find the lexicographically smallest substring of size k. Note: This problem can also be asked as find the lexicographically largest substring of size k Example: Input: “tutorial”, k = 2 Output: Smallest Lexicographically SubString: “al” Input: “tutorial”, k=3 Smallest Lexicographically SubString: “ial” Input: horizon, k=2 … Read more Find Lexicographically smallest or largest substring of size k