Ad
  • Custom User Avatar
  • Custom User Avatar

    The Description text should have some escapes in front of *s ( and possibly _s ).

    * is used to start / end italics ( as is _ ). If you want just a *, you should escape it, with \.

  • Custom User Avatar
  • Custom User Avatar

    Other Issues with your test cases:

    If there is no correct answer, return an empty array.

    AFAIK that isn't tested at all in your Test Cases. Either remove it from the Description or add edge assertions to address it.

    Find a solution which doesn't use brute force.

    Again, the tiny number of assertions in your Test Cases means that any brute-force solution can easily pass all tests without timing out. If you really want to prevent inefficient solutions from passing, enforce it. Add such a large number of random assertions in the Test Cases that even the most efficient solution just completes under 12000 ms (Codewars code execution time limit). Otherwise, I would suggest simply removing it from the Description.

  • Custom User Avatar

    Codewars Forums - Kata Best Practices - Have Full Code Coverage

    Expected: [0, 4], instead got: [0, 4]
    Expected: [1, 5], instead got: [1, 5]
    Expected: [1, 4], instead got: [1, 4]
    Expected: [1, 5], instead got: [1, 5]
    Expected: [5, 9], instead got: [5, 9]
    

    I haven't actually managed to pass the tests yet (see my other Issue posted below) but every time I run "Attempt", I get the exact same failed output which shows that your tests are not randomly generated at runtime.

    Having only 5 fixed assertions in your entire test suite is unacceptable and far from sufficient from preventing logically flawed and/or hardcoded solutions from passing. Please either (1) increase the number of unique, distinct fixed assertions to at least 20 including edge cases or (2) even better, write 100+ random test cases as per standard Codewars practice which is generally preferred over just 20+ fixed tests.