Sorting Problems In Leetcode Python