Submit | All submissions | Best solutions | Back to list |
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.
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 |
hide comments
|
||||||||||||
2013-05-29 18:43:56 praveen123
@nitish rao, You are removing the leading zeros, you do not have to remove that. Exact number of digit should be printed. |
||||||||||||
2013-05-29 18:40:33 praveen123
@evil_hack: you are printing an extra blank line in every test case. Remove that and enjoy :) |
||||||||||||
2013-05-29 17:34:34 evil_hack
@praveen123 plz check my latest soln.... i cannot figure out any cases where it might be giving WA |
||||||||||||
2013-05-29 17:33:20 evil_hack
@praveen123 I have check for 100's of input and I am getting correct answer.Can you please tell me what is the problem in my solution. |
||||||||||||
2013-05-25 08:38:05 nitish rao
@praveen123 can you please jst check my solution and hint me of where i am going wrong... i was getting WA.. id:9350152.. edit:Thanks a million.. praveen123.. :) :) Last edit: 2013-06-05 16:24:36 |
||||||||||||
2013-05-02 06:48:14 Ashish Lavania
@praveen123 plz check my latest soln.... i cannot figure out any cases where it might be giving WA --> answer(by praveen123), Your code is not outputting anything in some test cases, For which there should be a output thanks!! Last edit: 2013-05-02 03:17:18 |
||||||||||||
2013-05-02 06:48:14 akash kumar
though it is giving wrong ans continously.. my solution code is 9025689. ---> (praveen123) I am editing your comment as you have got accepted , I think that your comment was giving some hints to the problem. I hope you won't mind :) Last edit: 2013-04-04 13:26:30 |
||||||||||||
2013-05-02 06:48:14 majd gda
"if value of n is equal to k. then just print a new line." is it "value of n" or "no of digits in n" ??? EDIT: no of digits in n Last edit: 2013-03-31 04:27:30 |
||||||||||||
2013-05-02 06:48:14 praveen123
@amit jain: try some random small cases. You would find the error. Even in the case of only 1/2 removal. |
||||||||||||
2013-05-02 06:48:14 Amit Jain
@praveen123-thanx 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.ID--8900709 Are there unnecessary digits in the output?? Last edit: 2013-03-15 18:21:24 |