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.
Input
T: no of test cases
T line follow
every line has
n , 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:
20130502 06:48:14
@amit jain: try some random small cases. You would find the error. Even in the case of only 1/2 removal. 

Amit Jain:
20130502 06:48:14
@praveen123thanx for your reply,but i am unable to fix the issue.For removing that random character,I am printing all characters only when in between '0' and '9'..still getting wrong answer.ID8900709


praveen123:
20130502 06:48:14
some random character is getting printed in the output. Rest seems fine. 

Amit Jain:
20130502 06:48:14
getting wrong answer again and againID8890646..working fine for gievn test cases...can u please help me know some cases where my code fails? Last edit: 20130314 17:36:52 

Amit Jain:
20130502 06:48:14
Last edit: 20130314 09:04:23 

Orchid:
20130502 06:48:14
@praveen123 my email id is orchidmajumder@gmail.com..please send..and i;m also trying to modify my approach.. 

Ashish Lavania:
20130502 06:48:14
@praveen123 : O(n+k) soln not working.... TLE! 

Adhityaa:
20130502 06:48:14
Output is :


praveen123:
20130502 06:48:14
@Orchid Majumder : give me your email id , So that I could give you largest test case, If there is any other way of helping you out, I will be happy to do that. 

Orchid:
20130502 06:48:14
@praveen123 : on my machine for a 99999 char input array both n and k it takes 0.072 seconds. Last edit: 20130301 17:45:25 
Added by:  praveen123 
Date:  20130209 
Time limit:  0.407s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  general 