Problem

Return true if arr is sorted non-decreasing.

Examples

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