Given an array of integers
A tower is good if it is strictly greater than the tower to the left of it and is strictly smaller than the tower to the right of it. Towers at the start and end of the array cannot be good.
Input Specification
You will receive two lines of input. The first will be integer
The next line will contain
It is guaranteed that each tower's height is in the range
Output Specification
Output the number of good towers.
Sample Input 1
Copy
5
1 3 4 2 5
Sample Output 1
Copy
1
Comments
I have tried and tried and I can't figure out where I have gone wrong. It seems like a simple enough problem but 2 of the test cases keep failing and I don't know why.
Consider the test case