Leetcode Array Sorting Algorithm