Remove shortest subarray to sort array | Apple Interview Question