Finish leetcode_542.