#C9624. Remove K Digits

    ID: 53738 Type: Default 1000ms 256MiB

Remove K Digits

Remove K Digits

Given a non-negative integer represented as a string and an integer \( k \), remove exactly \( k \) digits from the number so that the new number is the smallest possible.

You are required to remove \( k \) digits from the given number string. If the result contains leading zeros, they should be stripped, and if the result is empty, output '0'.

For example, given \( num = \texttt{\"1432219000\"} \) and \( k = 3 \), the smallest possible result is \( \texttt{\"1219000\"} \).

inputFormat

The input is given via standard input and consists of two lines:

  1. The first line contains a non-negative number as a string.
  2. The second line contains an integer \( k \), indicating the number of digits to remove.

outputFormat

Output the smallest possible number (as a string) after removing exactly \( k \) digits. The result should have no leading zeros unless the number is zero.

## sample
1432219000
3
1219000