number. Strike out exactly k of its digits (the rest keep their order) so that the resulting number is as small as possible.
Return that number as a string without leading zeros. If no digits are left, or only zeros are, return "0".number="5291", k=2 → '21'
Strike out 5 and 9 to get 21; nothing smaller is possible.
number="30045", k=1 → '45'
Remove the 3 to get "0045", which is "45" without the leading zeros.
number="7", k=1 → '0'
All digits are gone, which counts as 0.
number consists of digits onlynumber has no leading zeros unless it is 0 itselfnumber="5291", k=2
'21'
Run checks the first 3 tests in your browser. Submit checks all 110 tests on the server, hidden ones included.