Finish leetcode_543.