num and a digit digit that occurs in num at least once. Strike out exactly one occurrence of digit from num so that the remaining number is as large as possible.
Return that number as a string.num="4747", digit="4" → '747'
Dropping the first 4 gives 747, dropping the second gives 477. The larger one is 747.
num="92", digit="2" → '9'
There is only one 2, so 9 remains.
num="3633", digit="3" → '633'
num consists of digits from 1 to 9digit is a digit from 1 to 9digit occurs in numnum="4747", digit="4"
'747'
Run checks the first 3 tests in your browser. Submit checks all 99 tests on the server, hidden ones included.