Wayfair Interview Question

Compute the maximum number of contiguous subarrays such that, when each subarray is sorted, the entire array is sorted.

Interview Answer

Anonymous

May 7, 2022

This is the number of new minimum values encountered while traversing the array from right to left.