revised util leetcode_102