passed on leetcode