Remove K Digits
Given a string num representing a non-negative integer and an integer k, return the smallest possible integer after removing k digits from num.
Example 1
Input
num = "1432219", k = 3Output
"1219"Remove the three digits 4, 3, and 2 to form the new number 1219, which is the smallest.
Example 2
Input
num = "10200", k = 1Output
"200"Remove the leading 1 and the number is 200; the output must not contain leading zeroes.
Constraints
- 1 <= k <= num.length <= 10^5
- num consists of only digits.
- num does not have any leading zeros except for the zero itself.