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.
@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?
yipee... AC on my first attempt :D
@praveen: could you please look into my solution, I am doing it in O(n) and still getting TLE for judge 3.
If the answer contains leaning zeros, should we print them or omit them?
Achmet ibn Rashid:
AC on first try :-) easy problem.
@Rajarshi Saha its 045. Print all numbers that are not deleted in the same order as stated.
@praveen123 can you tell me what should be the output for 0045 1? Shall it be 005 or 045; not clear about this.
Finally.. AC :)
This gave me immense joy!!!AC