Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
We can sequentially check if “999”, “888”, “777”, … , “000” exists in num in that order. The first to be found is the maximum good integer.
If we cannot find any of the above integers, we return an empty string “”.