Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- k = 0
- if a[0] < a[1]:
- k += 1
- for i in range(1, n-1):
- if a[i-1] > a[i] < a[i+1]:
- k += 1
- if a[n-1] < a[n-2]:
- k += 1
- print(k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement