You are given an array of integers nums.
Your task is to determine if the array is sorted in non-decreasing order.
You may assume that:
Return true if the array is sorted in non-decreasing order, otherwise return false.
[1, 2, 3, 4, 5]
True
The array is sorted in ascending order.
[1, 3, 2, 4, 5]
False
The element 3 is greater than 2, so the array is not sorted.
[1, 1, 1, 1]
True
All elements are equal, which counts as non-decreasing order.
[1, 2, 3, 4, 5]
True