A marker is visible only if it is strictly taller than every marker ahead. Task: Print values strictly greater than every value to their right, preserving original order. The last value is always included. Input format: n followed by n integers. Output format: Leader values separated by spaces. Constraints: 1 <= n <= 100000; -10^9 <= a[i] <= 10^9 Edge rules: Apply the stated zero, tie, boundary, and ordering conventions exactly.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 100000; -10^9 <= a[i] <= 10^9
Tags:
