3 ms·
The search part is definitely considered “bad form” by human solvers. Author apparently lacked the insight that elimination is generalizable to “if any set of
by femto113 7y ago
The search part is definitely considered “bad form” by human solvers. Author apparently lacked the insight that elimination is generalizable to “if any set of N peers contains exactly N distinct values you can eliminate those values from all peers not in the set”, rather than just “if 1 square contains 1 value ...”. That alone would solve all but the hardest puzzles with just a few more lines of code.
- T-hawk 7y agoI think the author had that insight, just chose not to use that route because it wasn't necessary. For either a human or machine solver, the trial and error route may well be simpler / less code / faster at runtime than implementing and executing every way to recognize a set of N peers for N values.