leetcode738】的更多相关文章

Given a non-negative integer N, find the largest number that is less than or equal to Nwith monotone increasing digits. (Recall that an integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.) Exampl…
public class Solution { public int MonotoneIncreasingDigits(int N) { var num = N.ToString(); var len = num.Length; ) { return N; } int[] X = new int[len]; ; i < len; i++) { X[i] = Convert.ToInt32(num[i].ToString()); } var change = true; while (change…