Finish leetcode_310.