leetcode solution & test 1