Finish leetcode_521.