Press "Enter" to skip to content

Posts tagged as “decresing”

花花酱 LeetCode 896. Monotonic Array

An array is monotonic if it is either monotone increasing or monotone decreasing.

An array A is monotone increasing if for all i <= jA[i] <= A[j].  An array A is monotone decreasing if for all i <= jA[i] >= A[j].

Return true if and only if the given array A is monotonic.

Solution: 

C++

Java

Python