Sudoku

Company: JPMC

Difficulty: medium

Problem Statement

Sudoku Sudoku is a logic-based number placement puzzle played on a `9 x 9` grid. The grid is divided into nine `3 x 3` boxes: rows `1-3`, `4-6`, `7-9` crossed with columns `1-3`, `4-6`, `7-9`. A grid is **solved** when all of the following hold: 1. Every cell contains exactly one digit `x` with `1 <= x <= 9`. 2. Every row contains each of the digits `1` to `9` exactly once, with no repetition. 3. Every column contains each of the digits `1` to `9` exactly once, with no repetition. 4. Every `3 x 3` box contains each of the digits `1` to `9` exactly once, with no repetition. You are given a partially filled grid in which some digits are missing. Missing cells are marked with `0`. Replace every `0` with a digit from `1` to `9` so that the completed grid is solved, and print the completed grid. Input Format Nine lines. Line `i` describes row `i` of the grid, top row first, and contains nine integers separated by single commas and no spaces. Each value is a digit from `0` to `9`, wher