Remove K digits

The code fails all test cases on submitting. Can’t figure out why…

Hi @Rheaaa please check for test case :
string : 10056
k = 3
your output is 00, rather should be 0

Continuing the discussion from Remove K digits:

I made that change…Still it fails all test cases

test cases :
10200 1 your output 0200 but output should be 200
10056 3 your output 00 but output should be 0
check for these type of test cases where it fails

How can this be optimized. It gives TLE.

hi @Rheaaa ,
check this I’ve added detailed comments https://ide.codingblocks.com/s/655529

Hope it clears your doubt

1 Like

@Rheaaa hope the doubt is clear
if yes please mark it resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.