ALG-E009EasyArrays
Sorted Order Check
Return true if each element is less than or equal to the element immediately after it. Empty and one-element arrays are sorted.
Contract
input numbers: integer[]
return boolean
Examples
Example 1
numbers = [1, 2, 2, 5]
→ true
Example 2
numbers = [1, 3, 2]
→ false
5 judge tests (2 shown above). Target complexity: O(n).