In Glyph City, the city planners have arranged building heights in a row, but some sections are out of order. The city wants to find the smallest section (window) that, when sorted, makes the entire row of buildings sorted. Given an array of integers that are out of order, determine the bounds of the smallest window that must be sorted in order for the entire array to be sorted.
Example 1:
Example 2:
Constraints:
1 <= n <= 1000 -10^9 <= arr[i] <= 10^9 All elements are distinct.
Tags:
