Finish leetcode_227