rewrite leetcode sort list