second pass of leetcode