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
# Associated newsletter: https://buttondown.com/hillelwayne/archive/solving-linkedin-queens-with-smt/ | |
# See also: https://ryanberger.me/posts/queens/ | |
# And: https://github.com/ryan-berger/queens/blob/master/main.py | |
from z3 import * # type: ignore | |
from itertools import combinations, chain, product | |
solver = Solver() | |
size = 9 | |
# queens[n] = col of queen on row n |