conturi
After the cowardly attack of a hacker on the server of bank MoneyForNothing, its manager has realized that he has to change the numbers of all existing accounts, due to security reasons. Obviously, the modification has to be done very quickly, and that is why the manager decides that each account number n is to be replaced by the largest number that can be obtained from n by deleting exactly k digits, however maintaining the initial order of digits.
Task
Being given integers n and k, written in base 10, determine the largest number that can be obtained from n by deleting exactly k digits, keeping the initial order of the digits.
Input Data
Input file conturi.in contains on the first line the number k, and on the second line the number n.
Output Data
Output file conturi.out will contain a single line with the requested number.
Constraints
Examples
conturi.in | conturi.out | conturi.in | conturi.out |
3 4152471 |
5471 | 4 883712921 |
88921 |
Time limit: 0.1 seconds/test
lect. drd. Radu Boriga
"Titu Maiorescu" University - Bucharest
Contact:r_boriga@yahoo.com