Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
but then the check of the 3x3 subgrids will not total 45 they they have to
You could still have
[9, 9, 9, 9, 9, 0, 0, 0, 0, 0] == 45
be true while having all values in the range 1 to 9I'd like to mention in the kata description it is already clearly stated that the input is from
[1, 9]
list. BTW I liked your keen attention.What if I have a sudoku row like [1,1,1,3,4,5,6,7,8,9], isnt the sum 45 anyway? or just [45, 0 ,0, ...]?
This is the second comment that claims
O(n^2)
. Is linear time complexity really that difficult to recognize? You should definitely have a firm grasp of time complexity before criticizing people about it.This is about
O(2n)
andO(n)
amortized.How is it O(n²)? Depending on the memory allocation algorithm it might be (but I think it's very unlikely) but it's implementation-defined.
this is a clerver solution but not a besetpractices solution
This comment is hidden because it contains spoiler information about the solution
Kata description says:
meh. it works but you not really pushing an iteam to a List.