0738. Monotone Increasing Digits
https://leetcode.com/problems/monotone-increasing-digits
Description
An integer has monotone increasing digits if and only if each pair of adjacent digits x
and y
satisfy x <= y
.
Given an integer n
, return the largest number that is less than or equal to n
with monotone increasing digits.
Example 1:
Example 2:
Example 3:
Constraints:
0 <= n <= 109
ac
Last updated