Question
String Quest
Ria receives a string str and an integer k.
Her challenge is to create the lexicographically largest string possible by deleting at most k characters from str.
Can you help Ria find the solution?
Her challenge is to create the lexicographically largest string possible by deleting at most k characters from str.
Can you help Ria find the solution?
Input
The first line of input contains a the string str.
The second and final line of input contains a single integer k.
The second and final line of input contains a single integer k.
Output
Print the lexicographically largest string possible after removing not more than k characters.
Example
Sample Input
abzccd
4
Sample Output
zd
Explanation
The first two characters and two characters after 'z' can be removed to get string "zd". It can be observed that no lexicographically larger string can be formed.
abzccd
4
Sample Output
zd
Explanation
The first two characters and two characters after 'z' can be removed to get string "zd". It can be observed that no lexicographically larger string can be formed.