Ad
  • Default User Avatar

    I did exactly that, O(1) for one prime and using inclusion-exclusion means that I have to do that binom(n, k) times for 1 <= k <= n.
    I pass 6 out of 6 30 digits tests but then my code times out. Am I still missing something?

  • Custom User Avatar

    great, just solved it, thanks for the motivational speech ;)

  • Custom User Avatar

    Really cool kata, it should be much more popular. The description seems scary, but the task itself is not that hard. Give it a try!

  • Custom User Avatar

    Thank you for the review!

    • Contructor got removed, solve() is now static and expecting the cave as an input
    • Logs removed from random tests
    • Tests are now grouped into 100 element groups, the overall number remains the same
    • The three issue was actually the same error, you found all pits yet remained distrustful when it came to squares near to SOUND blocks. It is now fixed, and the edge cases you found got added as sample tests. Nice catch, thank you!

    Grouping the tests into different suites, I'm not sure either if it is possible. I could probably put the 20 sample tests into the same @Test when it comes to executing all of them, so it would look a bit cleaner... ? The order of the n-pit random tests would remain messed up tho.

  • Custom User Avatar

    and another

    expects False  --> Python reference solution expects True
    
    __WP
    ____
    P__P
    ___G
    
  • Custom User Avatar

    another one

    expects False  --> Python reference solution expects True
    
    ___P
    ____
    P__P
    __GW
    
  • Custom User Avatar
    • I haven't investigated why your solution is incorrect, or on which step it makes an incorrect deduction. I hope you will find out :)
    • Sometimes, my solution passes all random tests, so I think your solution just handles one particular type of cases incorrectly.
  • Custom User Avatar

    minor suggestion:

    • don't use a class with state in the constructor, because this will add unwanted complexity, such as, what if 'solve' is called multiple times in succession, should it still work? If a user only initialised properly in the constructor, and updates the 'cave' in 'solve', a second call to 'solve' will fail.
    • use a static 'pure' method instead, and leave out the constructor
  • Custom User Avatar

    Some strong suggestions:

    • don't log to the console in the test cases (you may wish to log in the sample tests though)
    • make smaller batches of random tests -> max 100 tests in each @Test (the total amount of random tests should remain the same though)
    • if possible, group your fixed tests in a suite, and the random tests in another suite (not sure this is possible in Java on Codewars), now I get some random tests, then fixed tests, then again some random tests in the test explorer
  • Custom User Avatar

    I found an issue:

    expects False  --> Python reference solution excepts True
    ____
    ____
    _P_P
    _GWP
    
  • Custom User Avatar
  • Custom User Avatar

    I only notice this now. I'll try to review this asap.

  • Custom User Avatar
  • Default User Avatar

    Approved - thanks @koba1996 for translating and making the edits after the reviewing!

  • Default User Avatar

    Hi @koba1996 - it seems like it's all good now, so I'll approve: thanks again for translating! And thanks to @Madjosz and @B4B for reviewing.

  • Loading more items...