#t364. 删数问题

删数问题

Digit Deletion

Problem Description

A high-precision positive integer nn (at most 250250 digits) is entered from the keyboard. After deleting any kk of its digits, the remaining digits, in their original left-to-right order, form a new non-negative integer. For the given nn and kk, find a scheme that makes the new number formed by the remaining digits as small as possible.

Input Format

Two lines of positive integers.

The first line is the high-precision positive integer nn.

The second line is a positive integer kk, the number of digits to delete.

Output Format

One integer: the smallest remaining number.

Sample Input

175438
4

Sample Output

13

Constraints

Let len⁡(n)\operatorname{len}(n) denote the number of digits of nn. It is guaranteed that 1≤k<len⁡(n)≤2501 \le k < \operatorname{len}(n) \le 250.