Problem

Return true if arr is in non-decreasing order (each element >= the previous).

Examples

  • isSorted([1, 2, 2, 5]) -> true
  • isSorted([3, 1, 2]) -> false
Compile and test (Ctrl+Enter)