Search⌘ K
AI Features

Valid Sudoku

Explore techniques to validate a 9x9 Sudoku board by ensuring digits 1 to 9 appear only once per row, column, and 3x3 sub-box. Learn to implement this validation efficiently using hash maps to help prepare for coding interviews.

Statement

Given a 9 × 9 Sudoku board, determine whether it is valid. A board is considered valid if all of the following conditions hold (considering only the filled cells):

  • Each row contains the digits 1–9 at most once.

  • Each column contains the digits 1–9 at most once.

  • Each of the nine 3 × 3 sub-boxes contains the digits 1–9 at most once.

You do not need to ...