Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Can you please explain me what exactly changed in Python 3 which makes the solution break?

  • Custom User Avatar

    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))

  • Default User Avatar

    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.

  • Custom User Avatar

    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)

  • Custom User Avatar

    Input validation isn't required in this kata.

  • Custom User Avatar

    In this case everything is OK. Sudoku includes only 0-9 numbers.

  • Custom User Avatar

    This solution works for the given tests, but if you insert random numbers (E.g. - 11, 99) it does not detect any problem.

  • Custom User Avatar

    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

  • Custom User Avatar

    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.

  • Default User Avatar

    I am also getting the same issue can you please help ?

  • Custom User Avatar

    The tests are randomly shuffled, but they are ok. Both tests expects false if you don't get why, read the instructions again.

    JavaScript Completions 4186

  • Custom User Avatar

    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,

  • Custom User Avatar

    I think the test case for fourth one is mixed with the first one

  • Custom User Avatar

    Description:

    so that each column, each row, and each of the nine 3x3 sub-grids (also known as blocks) contain all of the digits from 1 to 9.

  • Loading more items...