the solution of leetcode