← 返回 walmartlabs 的题目列表Validate Sudoku
类型:online_judge
Given a Sudoku grid, determine if it is a valid grid.
Input
int[][] representing the Sudoku grid where rows and columns are equal in length, and each cell may contain numbers (0-9).
Output
Boolean value indicating whether the grid is valid. A valid Sudoku is one where each number appears only once in each row, column, and 3x3 sub-grid.
Example
Input
[[5,3,0,0,7,0,0,0,0], [6,0,0,1,9,5,0,0,0], [0,9,8,0,0,0,0,6,0], [8,0,0,0,6,0,0,0,3], [4,0,0,8,0,3,0,0,1], [7,0,0,0,2,0,0,0,6], [0,6,0,0,0,0,2,8,0], [0,0,0,4,1,9,0,0,5], [0,0,0,0,8,0,0,7,9]]