The Smallest Number
Limits: 2 sec., 256 MiB
Some integer number \(N\) is written on a board. You can erase at most \(K\) it’s digits (maybe none). Then you consider the number \(X\) formed by digits that are left on the board. You want \(X\) to have at least one digit, do not start with zero and to be as small as possible. What is the smallest \(X\) you can get?
Input
Two integers \(N\) and \(K\) separated by a single space.
Output
The smallest number you can get.
Constraints
\(1 \le N, K \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 7074 2 | 70 |
| Input (stdin) | Output (stdout) |
|---|---|
| 7074 3 | 4 |
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|