Rosetta Problems

Find the Number of Subarrays Where Boundary Elements Are Maximum

https://leetcode.com/problems/find-the-number-of-subarrays-where-boundary-elements-are-maximum