Problem 2, Python
Problem 2, Python using itertools
Problem 3, Python