~/algor $ cat problems/stack-k-raqamni-ochirish
Remove k digits
Hard
2000 ms
128 MB
67%
A positive integer $N$ (it may be very long) and an integer $k$ are given. Delete exactly $k$ digits from the notation of $N$ (the order of the remaining digits does not change) so that the resulting number is as small as possible. Print this number without unnecessary leading zeros (if all digits are zeros, print $0$).
Input
The first line contains $N$, the second line contains $k$.
Output
The smallest resulting number.
Note
the notation of $N$ has $1$ to $2 \cdot 10^{5}$ digits and does not start with $0$
$0 \le k \lt$ the number of digits of $N$
Examples
Input #1
1432219 3
Output #1
1219
Input #2
10200 1
Output #2
200