Skip to content

Commit e37ef27

Browse files
committed
896
1 parent 64841b1 commit e37ef27

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Sort/896.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Monotonic Array
2+
3+
#### Description
4+
5+
[link](https://leetcode.com/problems/advantage-shuffle/)
6+
7+
---
8+
9+
#### Solution
10+
11+
- See Code
12+
13+
---
14+
15+
#### Code
16+
17+
O(nlog(n))
18+
19+
```python
20+
class Solution:
21+
def isMonotonic(self, A: List[int]) -> bool:
22+
B = sorted(A)
23+
return B == A or B == A[::-1]
24+
```

0 commit comments

Comments
 (0)