This project aims to find a fast solution to the Skyscraper puzzle.
Skyscraper is a logic puzzle where you fill a grid with numbers representing building heights while following visibility constraints.
I discovered this puzzle in Sekai CTF 2026, the 67 puzzles.
The solver uses row-based backtracking with candidate pre-filtering.
At each step, the algorithm:
- Generates all row permutations and filters them using left and right clues.
- Sorts rows by candidate count (fewest first) to reduce branching.
- Tries one candidate row at a time and checks column uniqueness incrementally.
- Backtracks on conflict; after all rows are placed, validates top and bottom clues.