Given a string made up of only lowercase letters, and a natural number , remove any substring of length from so that the result is the lexicographically smallest possible word.
Input consists of several cases, each with and . Assume .
For every case, print the alphabetically smallest word that can be obtained after removing consecutive letters from .
Author: Salvador Roura
Generation: 2026-01-25T12:01:57.312Z
© Jutge.org, 2006–2026.
https://jutge.org