Algorithm · Karat · Medium
This problem has three parts. Each one is about checking or changing a grid, or a board, against a set of rules. Part 1: Validate an N x N matrix. You are given a square matrix with N rows and N columns. Decide whether it is valid. A matrix is valid when every row contains each of the numbers from 1 through N exactly once, and every column does too. Part 2: Validate a nonogram grid. You are given a filled-in nonogram grid along with run-length instructions for each row and…