XYZ Interview Question

Subarray minimum question for final round