Sort A Nearly Sorted Array Leetcode Problems For Python