Given an unsorted array sort the shortest sub-array which results in sorting of the whole array

join shbcf.ru