Monotonic Array
A list is monotonic if it never goes down (non-decreasing) or it never goes up (non-increasing). Equal neighbours are fine.
Return True if nums is monotonic, otherwise False.
Example 1
nums [1,2,2,3]
returns true
Never goes down.
Example 2
nums [1,3,2]
returns false
It goes up, then down.
Constraints
1 <= len(nums) <= 50-100 <= nums[i] <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.