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
javoxir_99:
2020-12-22 17:12:27
Hello you tell me a test that my code gives an error.please
|
|
urimaj:
2020-04-04 21:42:19
output leading zeros
|
|
ssvarma:
2018-06-24 14:55:45
@praveen123:hi! can u pls tell me where i m lacking in my code 21889739
|
|
sameer Hussain:
2016-11-16 12:18:47
I am getting TLE, if I use segment tree, for finding out next maximum character.
|
|
hazem_khaled8:
2015-09-01 17:23:12
how can i avoid tle? (15041280)
|
|
CoNtRaDiCtIoN:
2015-05-26 08:17:31
@praveen123 lots of wa can u pls provide some test cases where my solution fails or u can look into my code and tell the probable bugs... Thanks in advance :) |
|
sahil hindwani:
2014-12-20 21:12:39
submission id :13224845 why is it giving wrong answer
|
|
Sudharsansai:
2014-12-11 19:09:07
Nice Problem!
|
|
$seraph$:
2014-10-03 05:49:14
@praveen123: Hi! can u pls tell me where i m lacking in my code 12526342. |
|
Archangel:
2014-05-21 16:42:09
@praveen123 I want to know that what is the way to remove k digits? Can k digits be removed from anywhere at random or k consecutive digits are to be removed?
|
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 |