Scott's answers for leetcode