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.
This comment is hidden because it contains spoiler information about the solution
Can you please explain me what exactly changed in Python 3 which makes the solution break?
wow such an amazing equation to make 3x3 box in the set3Array, I think it would be better if you add condition to check if there 0 in the cell
( set1Array.size != 9 || set2Array.size != 9 || set3Array.size != 9 ||set1Array.has(0) ||set2Array.has(0) ||set3Array.has(0))
yea @Voile... Not seeing what you are seeing... All the columns have the correct 1-9 config... ive added my own version of this issue. i have code that flips rows to columns an saves them in new array then checks both arrays. on top of that i just checked manually and cant seem to find any duplicates. so if you can point out the column in Number 4 that would be appreciated.
This solution passes the tests but to me is definitely not best practice. This solution works in python 2, and not in python 3. But if you just sort r it works the same in py3 as in py2. That's the difference. r comes out mostly sorted in py 2 from the creation of the set apparently.
BUT it still is not a great solution in py2 (or py3 with the sort). Yes it passes the tests, but it's not always going to get the right answer to different valid inputs.
For example - if you feed in the last test reversed (recreate alphabet backwards) it fails. But if the loop is run twice instead of once it does pass. So additional looping may be needed accurately reconstruct the secret with this approach. To see it fail trying to create alphabet backwards fork and add this to tests:
secret6 = secret5[::-1]
triplets6 = [x[::-1] for x in triplets5]
test.assert_equals(recoverSecret(triplets6), secret6)
Input validation isn't required in this kata.
In this case everything is OK. Sudoku includes only 0-9 numbers.
This solution works for the given tests, but if you insert random numbers (E.g. - 11, 99) it does not detect any problem.
Well clearly I've come up with a superior algo. This bad boi will calculate correctly formed and incorrectly formed roman numerals - E.g. IIIV = 7. I mean who actually knows how to properly form this ancient crap? This one can do it all!
This was fully intentional and totally not because I'm a failure at ancient accounting. /s
Check the last 2 columns, they have repeated numbers, so it's not a valid solution. Voile even marked the text you should pay attention to.
I am also getting the same issue can you please help ?
The tests are randomly shuffled, but they are ok. Both tests expects
false
if you don't get why, read the instructions again.I found an issue with fourth test case with JS.
This is the input array:
Here's the board I'm getting;
[ [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
[ 2, 3, 1, 5, 6, 4, 8, 9, 7 ],
[ 3, 1, 2, 6, 4, 5, 9, 7, 8 ],
[ 4, 5, 6, 7, 8, 9, 1, 2, 3 ],
[ 5, 6, 4, 8, 9, 7, 2, 3, 1 ],
[ 6, 4, 5, 9, 7, 8, 3, 1, 2 ],
[ 7, 8, 9, 1, 2, 3, 4, 5, 6 ],
[ 8, 9, 7, 2, 3, 1, 5, 6, 4 ],
[ 9, 7, 8, 3, 1, 2, 6, 4, 5 ] ]
But the test is being run on the array below:
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
1 2 3 4 5 6 7 8 9,
I think the test case for fourth one is mixed with the first one
Description:
Loading more items...