MAX_NUM - finding maximum possible number
Given a number n, Find out what max possible number you can make by deleting exactly k digits.
T : no of test cases <= 10^3
1 <= no of digits in n <= 10^5. (n might contain leading zeros)
0 <= k <= n
if value of n is equal to k. then just print a new line.
T: no of test cases
T line follow
every line has
n , k
max possible number
8756 2 Output: 23
Note that left to right order should be maintained. As in the example given answer is 23 not 32.
I feel that we are talking about different problem. What is the answer for: 313 1 ? My current code prints 33.
Any input where my code fails?
why can't the resulting number be 32 here ? should the ordering be preserved ?Last edit: 2013-02-09 15:01:37