For those who want to see how a backtracking algorithm would work. Computerphile walked through a python approach (11 lines) a few months ago:
https://www.youtube.com/watch?v=G_UYXzGuqvM
1 comments
That brought back some memories...that was pretty much what I did.