```
public bool CheckPossibility(int[] nums)
{
if (nums.Length == 0 || nums == null) return false;
if (nums.Length == 1) return true;
bool changed = false;
for (int i = 0; i < nums.Length-1; i++)
{
if(nums[i]>nums[i+1])
{
if (changed) return false;
changed = true;
if (i >0 && nums[i + 1] < nums[i - 1])
nums[i + 1] = nums[i];
else nums[i] = nums[i+1];
}
}
return true;
}
```