first attempt at week 6 solution - 2SAT with thanks to Tarjan (SCC)