solution and idea for some of the problem in leetcode