Segments with leftmost and rightmost elements as maximum
Filed under Medlife
The question
Given an array, find the number of segments where both the leftmost and rightmost elements are the largest element in that segment.
No write-up yet. Related questions below have one.
Related Medlife questions
Collected from public candidate posts and coding forums. Updated Nov 2026.