4 5 3 1 4 2 5 4 4 3 2 1 4 1 2 3 4 6 2 1 3 1 4 2
Sample tests: mixed, decreasing, increasing, complex pattern.
3 4 2 5
Given an array aaa of nnn integers.
An element at position iii is called a boundary element if at least one of the following is true:
Count the number of boundary elements.