My answer for leetcode