Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. ```
  2. class Solution:
  3. def solve(self, nums):
  4. is_strictly_increasing = all(nums[i] < nums[i + 1] for i in range(len(nums) - 1))
  5. is_strictly_decreasing = all(nums[i] > nums[i + 1] for i in range(len(nums) - 1))
  6. return is_strictly_increasing or is_strictly_decreasing
  7. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement