Solve problem "Greater than neighbours" online - Learn Python 3 - Snakify

Problem «Greater than neighbours» (Easy)


Statement

Given a list of numbers, determine and print the quantity of elemets that are greater than both of their neighbors.

The first and the last items of the list shouldn't be considered because they don't have two neighbors.


In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
1 2 3 4 5
0
5 4 3 2 1
0
1 5 1 5 1
2
5 1 5 1 5
1
5 5 5 5 5
0
1 1 1 5 1
1
345354
0
1 465
0
4 -54643
0
2147483647 0 1 2 3
0
1 2 3 4 -2147483648
1
-9 29 -100 64 26 73 -96 28 -92 11 -14 -86 -54 -67
6
2147483647 0 1 0 2147483647
1