This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /usr/bin/env python | |
# The point of this exercise is to find a list of 5 words with 25 unique letters across them. | |
# As suggested by https://www.youtube.com/watch?v=_-AfhLQfb6w | |
# | |
# This problem is equivalent to searching for a disjoint set in the graph induced on shared letters between words. | |
# That problem is equivalent to searching for a clique in the inverse graph. | |
# The approach used here builds the graph as edges first between letters, then between words. | |
# Each step increases the cliques it found by 1 word. | |
# |
OlderNewer