518. Find Smallest Possible Number
0
Medium
Given a non-negative integer num represented as a string and an integer k, find the smallest possible number that can be obtained by removing k digits from num.
Input Format
The first line contains the string num. The second line contains the integer k.
Output Format
Print the smallest possible integer as a string.
Example
Input
1432219
3
Output
1219
Constraints
1 <= k <= num.length <= 10^5
num is a string consisting only of digits
num does not have any leading zeros except for the zero itself
Loading...
View Submissions
Console