Problems > Range of an Array > Editorial

Range of an Array — Solution & Editorial

Back to the Problem

One pass keeping both the minimum and maximum; the answer is their difference.

Complexity: O(N)