Monotonic Array - Python Solution @ LeetCode
Monotonic Array, is a LeetCode problem. In this post we will see how we can solve this challenge in Python
Problem Description
Example 1 :
Input: [1,2,2,3] Output: true
Example 2 :
Input: [6,5,4,4] Output: true
Example 3 :
Input: [1,3,2] Output: false
Example 4 :
Input: [1,2,4,5] Output: true
Example 5 :
Input: [1,1,1] Output: true
Note :
1 <= A.length <= 50000
-100000 <= A[i] <= 100000
func isMonotonic(A []int) bool { if len(A) <= 1 { return t ....
You can find the full details of the problem Monotonic Array at LeetCode
Solution: Please check the main.py snippet for the solution.
This solution originally posted at: Github by @kamyu104
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login .