Deleting digits - MarisaOJ: Marisa Online Judge

Deleting digits

Time limit: 1000 ms
Memory limit: 256 MB
Given a positive integer $n$ with $d$ digits, find the largest number possible by removing exactly $k$ digits from the given number. ### Input - The first line contains a positive integer $n$. - The second line contains an integer $k$. ### Output - Print the largest possible integer after removing exactly $k$ digits from the number $n$. This number should not have a leading digit of $0$. ### Constraints - $1 \le d \le 10^5$. - $1 \le k < d$. ### Example Input: ``` 4231 2 ``` Output: ``` 43 ```