Running Minimum

Medium · rating 1200 · Arrays

The first line has n. The second line has n integers. Print the running minimum (smallest value seen up to each position), space-separated.

Constraints: 1 ≤ n ≤ 105

Related problems

Open Running Minimum in Code Arena →