Given an array of positive integers, output an array of all the elements that are greater than or equal to the adjacent ones. Most elements will have two adjacent elements; the first and last element are special cases, as they only have one adjacent element.
You may assume that the array contains at least two elements.
Test cases:
Input | Output
[4,2,6,12,4,5,4,3] | [4,12,5]
[1,2] | [2]
[1,2,3,2,1] | [3]
[3,2,1,2,3] | [3,3]
[4,4] | [4,4]
[2,4,4,4,1] | [4,4,4]
[2,3,3,4] | [3,4]
[4,3,3,4] | [4,4]
This is code-golf, shortest code wins!