Problems > Leaders of the Array > Editorial

Leaders of the Array — Solution & Editorial

Back to the Problem

Scan from the right maintaining the running maximum; elements strictly above it (before updating) are leaders. Reverse the collected list.

Complexity: O(N)