Ad
  • Default User Avatar

    I don't use JavaScript so I can't see your current solution, but if you are going through all numbers up to n and counting 9 inside each one, it will be too slow (even with just this "simple loop" rather than an "infinite loop").

    Maybe the 50ms timing is for very small tests you have tried? Like with n = 100 or something? In the full kata tests the input n goes to 10**19 - try your function with this value on your PC tests if you want to see how fast it is.

  • Custom User Avatar

    The goal of the game is to fill all cells of the grid with digits from 1 to 9, 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.

  • Default User Avatar

    It is still unsoluble,...

  • Custom User Avatar

    You're awesome to be able to focus on that, but the sense of accomplishment that comes with a solution is unparalleled.

  • Custom User Avatar

    I don;t think there's too many test inputs. In Javascript, there's 100 random tests, and each can have numbers up to 100 digits long. My JavaScript solution passes the tests in ~1 second. I think tests are balanced quite well, you just need better algorithm.

    Feel free to join Codewars Discord, you could get some help in the #help-solve channel!

  • Custom User Avatar

    What needs to be fixed is your code because it's not efficient enough. There is no bug in the kata.

    Note that a code being short or easy to read has nothing to do with it being efficient or not.