second iteration to solve the leetcode problems, update and refine
solutions