------
## 最终结论
```python
def monotoneIncreasingDigits(N: int) -> int:
    digits = list(str(N))
    n = len(digits)
    
    # Find the first position where the monotonicity breaks
    mark = n  # Start with the assumption that we won't need to change anything
    for i in range(n - 1):
        if digits[i] > digits[i + 1]:
            mark = i
            digits[i] = str(int(digits[i]) - 1)  # Decrease the current digit
            break
    
    # Set all subsequent digits to '9'
    for i in range(mark + 1, n):
        digits[i] = '9'
    
    # Join the digits and convert back to an integer
    result = int(''.join(digits))
    
    return result

# Example usage:
print(monotoneIncreasingDigits(10))   # Output: 9
print(monotoneIncreasingDigits(1234)) # Output: 1234
print(monotoneIncreasingDigits(332))  # Output: 299
```