Do problem 29 in Python. Try a fancy matrix approach, but also
include a forum solution that uses sets.