Valid Sudoku

Medium

📝 Description

Determine if 9x9 Sudoku board is valid (no duplicates in rows/cols/boxes)

Input Format

2D Sudoku board

Output Format

true/false

Constraints

board.length == 9

🔍 Sample Input

[["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8",".",".",".",".","6","."],["8",".",".",".","6",".",".",".","3"],["4",".",".","8",".","3",".",".","1"],["7",".",".",".","2",".",".",".","6"],[".","6",".",".",".",".","2","8","."],[".",".",".","4","1","9",".",".","5"],[".",".",".",".","8",".",".","7","9"]]
            

✅ Sample Output

true
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run