4 kyu
Validate Sudoku with size `NxN`
2,770 of 9,828cbmono
Description:
Given a Sudoku data structure with size NxN, N > 0 and √N == integer
, write a method to validate if it has been filled out correctly.
The data structure is a multi-dimensional Array, i.e:
[
[7,8,4, 1,5,9, 3,2,6],
[5,3,9, 6,7,2, 8,4,1],
[6,1,2, 4,3,8, 7,5,9],
[9,2,8, 7,1,5, 4,6,3],
[3,5,7, 8,4,6, 1,9,2],
[4,6,1, 9,2,3, 5,8,7],
[8,7,6, 3,9,4, 2,1,5],
[2,4,3, 5,6,1, 9,7,8],
[1,9,5, 2,8,7, 6,3,4]
]
Rules for validation
- Data structure dimension:
NxN
whereN > 0
and√N == integer
- Rows may only contain integers:
1..N (N included)
- Columns may only contain integers:
1..N (N included)
- 'Little squares' (
3x3
in example above) may also only contain integers:1..N (N included)
Arrays
Puzzles
Algorithms
Object-oriented Programming
Similar Kata:
Stats:
Created | Sep 6, 2014 |
Published | Sep 6, 2014 |
Warriors Trained | 34093 |
Total Skips | 11245 |
Total Code Submissions | 156728 |
Total Times Completed | 9828 |
JavaScript Completions | 2770 |
CoffeeScript Completions | 44 |
Python Completions | 4768 |
Ruby Completions | 511 |
Rust Completions | 840 |
C# Completions | 1028 |
Total Stars | 936 |
% of votes with a positive feedback rating | 84% of 1268 |
Total "Very Satisfied" Votes | 946 |
Total "Somewhat Satisfied" Votes | 247 |
Total "Not Satisfied" Votes | 75 |