pass leetcode problem 6