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 : number of test cases <= 10^3.
1 <= number 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.
Input
T: number of test cases.
T lines follow each with n and k.
Output
max possible number.
Example
Input: 2 1223 2 8756 2 Output: 23 87
Explanation
Note that left to right order should be maintained. As in the example given answer is 23 not 32.
hide comments
praveen123:
2013-05-02 06:48:14
I have updated the problem statement to make it more cleaner, I have also modified the test cases. Three solutions have been accepted.
|
|
praveen123:
2013-05-02 06:48:14
hi all,
|
|
:D:
2013-05-02 06:48:14
Re praveen123: Pretty much what Robert said. For test cases here my solutions coincide. Could you print some small case where any of us fails? |
|
Robert Gerbicz:
2013-05-02 06:48:14
My code prints the same answers for that two input. But you can see our code as (here) you are the problem setter.
|
|
praveen123:
2013-05-02 06:48:14
:D , you are printing out a huge streak of 9's as in the case of Robert.
|
|
Robert Gerbicz:
2013-05-02 06:48:14
I feel that we are talking about different problem. What is the answer for: 313 1 ? My current code prints 33. |
Added by: | praveen123 |
Date: | 2013-02-09 |
Time limit: | 0.407s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | general |