Return the largest number that is at most n and whose digits are in non-decreasing order from left to right (each digit is at least the one before it).
For n = 332 the answer is 299; for n = 1234 it is 1234; for n = 10 it is 9.
Example 1
Input:
monotone_increasing_digits(332)
Output:
299
Example 2
Input:
monotone_increasing_digits(10)
Output:
9
0 <= n <= 10**15No results yet
Run your code to check it against the examples, or submit to run every test.