My solution of leetcode.