#C8190. Lexicographically Smallest String After Removals

    ID: 52145 Type: Default 1000ms 256MiB

Lexicographically Smallest String After Removals

Lexicographically Smallest String After Removals

Given a string (S) of length (N) and an integer (K), remove exactly (K) characters from (S) so that the resulting string is the smallest possible in lexicographical order. You must remove characters while preserving the order of the remaining ones.

For example, if (S = \texttt{abcdef}) and (K = 2), the lexicographically smallest string after removal is (\texttt{abcd}).

inputFormat

The input is given from standard input and consists of two lines.

The first line contains two integers (N) and (K) separated by a space, where (N) is the length of the string (S) and (K) is the exact number of characters to remove.

The second line contains the string (S), which consists only of lowercase English letters.

outputFormat

Output the lexicographically smallest resulting string after removing exactly (K) characters from (S) to standard output.## sample

6 2
abcdef
abcd

</p>