leetcode: 8 problems