combinations iterative solution