i use a different approad to solve the sum ii. very tricky to avoid duplicate