leetcode Solution