Question
Given a crossword grid, a set of across/down clue entries, and candidate words for each clue, fill the grid so every entry uses one candidate and all crossing letters agree. ## Requirements - Define data structures for grid cells, clue slots, candidate domains, and crossing constraints. - Return one valid completed grid or report that none exists. - Use constraint propagation and backtracking rather than enumerating every combination. - Choose a search order such as minimum remaining values, and explain tie-breaking. - Restore domains correctly after a failed branch. - Handle prefilled letters, duplicate candidate words, disconnected regions, and ambiguous puzzles. You may propose an interface such as: ```python def solve_crossword(grid: list[str], entries: list[dict]) -> list[str] | None: ... ``` State the exact entry schema before coding. ## Follow-ups 1. Return all solutions or prove uniqueness. 2. Index a large dictionary by length and letter position. 3. Rank semantically plausible candidates derived from clue text. 4. Parallelize search without duplicating too much work.