Ad
  • Custom User Avatar

    I ran into a problem. The test puzzle isn't deterministic.

    My solver found this solution from your test case:

    [ 5, 3, 1, 2, 7, 6, 4, 9, 8 ]
    [ 6, 2, 3, 1, 9, 5, 8, 4, 7 ]
    [ 1, 9, 8, 3, 4, 7, 5, 6, 2 ]
    [ 8, 1, 2, 7, 6, 4, 9, 5, 3 ]
    [ 4, 7, 9, 8, 5, 3, 6, 2, 1 ]
    [ 7, 4, 5, 9, 2, 8, 3, 1, 6 ]
    [ 9, 6, 7, 5, 3, 1, 2, 8, 4 ]
    [ 2, 8, 6, 4, 1, 9, 7, 3, 5 ]
    [ 3, 5, 4, 6, 8, 2, 1, 7, 9 ];

    It's a valid Sudoku answer, but it doesn't work when validated against the specific result you're looking for. Similar problems occur when submitting the solution and comparing against the other test cases. Validation should really be testing for any valid solution rather than a specific solution.

  • Custom User Avatar

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

  • Custom User Avatar

    (isNaN(oct[i])) { return false; }

    This incorrectly trims the string. e.g: "12 " would return true. You need another way to handle the spaces.

  • Custom User Avatar

    Also add ))(( as a test case as several solutions incorrectly sum up the number without validating position.