LeetCode-896 Posted on 2021-03-05 Edited on 2025-02-13 In LeetCode 题目 结果 代码123456789101112131415func isMonotonic(A []int) bool { up := A[0] < A[len(A)-1] for i := 0; i < len(A)-1; i++ { if up { if A[i] > A[i+1] { return false } } else { if A[i] < A[i+1] { return false } } } return true}