We are given a partially filled square board.
- Empty cells in the input board are denoted by 0s
- Each non-zero number appears exactly twice on the board
- The non-zero numbers will range from 1-m, for some natural number, m
- Numbers already on the board in the input can't be removed, replaced or repositioned
- The goal is to pair up all the matching non-zero numbers on the grid with single continuous lines (or paths). The lines cannot branch off or cross over each other, and the numbers have to fall at the end of each line (i.e., not in the middle).
- To represent a line joining the two instances of a number m, the solver is expected to fill all the cells covered by the line joining the two instances with the number m itself in the output.
- While drawing a line from a grid cells, we can move only horizontally or vertically
