Rar the Cat is trying out his new correction tape. He takes a sheet of paper, containing an N-digit integer, and decides to remove K of these digits. The remaining digits will join together to form a new integer with N - K digits.
Help Rar find the minimum possible integer he can form. Note that the resultant integer cannot have leading zeroes.
The first line of input will contain two integers, N and K.
The second line of input will contain one integer, representing the original integer Rar has.
Output a single line containing one integer, the minimum possible resultant integer Rar can form.
1 ≤ K < N.
Subtask 1 (8%): 2 ≤ N ≤ 16.
Subtask 2 (12%): 2 ≤ N ≤ 2 000. Each digit in the integer will be a 0 or a 1.
Subtask 3 (14%): 2 ≤ N ≤ 2 000.
Subtask 4 (6%): 2 ≤ N ≤ 100 000. K = N - 1.
Subtask 5 (16%): 2 ≤ N ≤ 100 000. Each digit in the integer will be a 0 or a 1.
Subtask 6 (18%): 2 ≤ N ≤ 100 000. No digit in the original integer will be a 0.
Subtask 7 (15%): 2 ≤ N ≤ 100 000.
Subtask 8 (11%): 2 ≤ N ≤ 5 000 000.
Subtask 9 (0%): Sample Testcases
5 3 23195
15
10 6 9031193452
1132
5 2 10101
100
Subtask | Score |
---|---|
1 | 8 |
2 | 12 |
3 | 14 |
4 | 6 |
5 | 16 |
6 | 18 |
7 | 15 |
8 | 11 |
9 | 0 |