https://github.com/pedroka-dev/sudoku-validator
🔢 C# console application that validates if a string is a valid Sudoku grid or not.
https://github.com/pedroka-dev/sudoku-validator
coding-exercise csharp
Last synced: 10 months ago
JSON representation
🔢 C# console application that validates if a string is a valid Sudoku grid or not.
- Host: GitHub
- URL: https://github.com/pedroka-dev/sudoku-validator
- Owner: pedroka-dev
- License: mit
- Created: 2021-04-13T20:22:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T19:41:10.000Z (over 1 year ago)
- Last Synced: 2025-01-26T11:44:35.321Z (about 1 year ago)
- Topics: coding-exercise, csharp
- Language: C#
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sudoku-Validator
A console application that says if string is a valid Sudoku
# What is a Sudoku?
The Sudoku grid is a 9x9 matrix of integers. For it to be a valid solution, each row and column must contain all numbers from 1 to 9.
Additionally, if we divide the matrix into nine 3x3 regions, each of these regions must also contain the numbers from 1 to 9.
The example below shows a grid that is a valid Sudoku solution.
# Example
The input consists of several matrices. Each matrix is given in 9 lines, where each line contains 9 integers. Your program should print "SIM" if the matrix is a valid Sudoku solution, and "NAO" otherwise.
Input:
4 9 8 2 6 1 3 7 5
7 5 6 3 8 4 2 1 9
6 4 3 1 5 8 7 9 2
5 2 1 7 9 3 8 4 6
9 8 7 4 2 6 5 3 1
2 1 4 9 3 5 6 8 7
3 6 5 8 1 7 9 2 4
8 7 9 6 4 2 1 5 3
Output:
SIM