what does -> do?
where is row declared in valid9?
can someone explain the code please?
couldn't you avoid the "series whose unique numbers add up to 45 but are not valid sudoku wins. For example 2, 2, 9, 9, 6, 1, 8, 14, 5 or 0, 0, 0, 0, 0, 0, 0, 45. " by doing row.uniq.size == 9
Clever, but certainly does not work. One could easily include a number of series whose unique numbers add up to 45 but are not valid sudoku wins. For example 2, 2, 9, 9, 6, 1, 8, 14, 5 or 0, 0, 0, 0, 0, 0, 0, 45. These tests should have been included. This is excellent refactoring, but not excellent code.
The description looks good.
what does -> do?
where is row declared in valid9?
can someone explain the code please?
couldn't you avoid the "series whose unique numbers add up to 45 but are not valid sudoku wins. For example 2, 2, 9, 9, 6, 1, 8, 14, 5 or 0, 0, 0, 0, 0, 0, 0, 45. " by doing row.uniq.size == 9
what does -> do?
where is row declared in valid9?
can someone explain the code please?
credit to @marksiemers for
i/9/3*3 + i%9/3 == x
This comment is hidden because it contains spoiler information about the solution
@herathe - I dislike the monkeypatching of
Array
=\This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Likely code runner server performance issues, check: https://codewars.statuspage.io/
Likely code runner server performance issues, check: https://codewars.statuspage.io/
That one is a fake! :)
Clever, but certainly does not work. One could easily include a number of series whose unique numbers add up to 45 but are not valid sudoku wins. For example 2, 2, 9, 9, 6, 1, 8, 14, 5 or 0, 0, 0, 0, 0, 0, 0, 45. These tests should have been included. This is excellent refactoring, but not excellent code.
Description isn't clear. The given link had a better explanation of expected output. More examples would be useful.
Maybe the problem was changed, but this wasn't a problem for me.
I guess the docs don't explicitly mention that
all?
short-circuits too. The same is true ofnone?
andany?
, by the way.Temporary objects will be created in memory anyways. I prefer to avoid line wrapping and indent-nesting when possible.
Also updated
valid9
criteron because there was no guarantee of only positive numbers.Loading more items...