My code for leetcode