

I was thinking of a recursive backtracking algorithm that starts at row 0, and for each possible arrangement of that row given the information from the row clue, it places a possible combination of the next row and verifies whether it is a valid placement given the column clues. Naturally I had the inclination to try and write a program that would solve it for me. For example, a clue of "4 8 3" would mean there are sets of four, eight, and three filled squares, in that order, with at least one blank square between successive groups." In this puzzle type, the numbers are a form of discrete tomography that measures how many unbroken lines of filled-in squares there are in any given row or column.

So I recently saw this puzzle posted by the British GCHQ:Ī nonogram is picture logic puzzles in which cells in a grid must be colored or left blank according to numbers at the side of the grid to reveal a hidden picture.
