leetcode submission 9 with test