#3113

Find the Number of Subarrays Where Boundary Elements Are Maximum

international master · 1905 · lc hard +32 · 32.9% accepted · 262 likes · top 10%

Description

Given a positive integer array nums, count the subarrays in which both the first element and the last element are equal to the maximum element of that subarray.

Code

1
2
3