Ad
  • Custom User Avatar

    Your solution has a bug and works incorrectly for some inputs, depending on order of intervals. See these intervals which should sum up to 19:

    [(1, 6), (1, 5), (10, 20), (16, 19), (5, 11)] - your result is 20
    [(1, 5), (1, 6), (10, 20), (16, 19), (5, 11)] - your result is 19
    

    The strange behavior of tests you see is because in this challenge, for some reason, tests always shuffle inputs before calling your function. This is why your solution sometimes passed, and sometimes fails: because tests sometimes generate inputs which trigger the bug in your solution, and sometimes not.

  • Custom User Avatar

    I tried to solve it but I am having an undefined behaviour when testing, it always succeeds examples but when trying to attempt large scale test scenarios it sometimes fails the tests it made for the example test scenarios which were successful beforehand.Also when I re-attempt it ,it sometimes fails 3, sometimes 2 and sometimes 1 even though the code is untouched between attempts.

  • Custom User Avatar

    Your code being wrong is not a kata issue. You are directly returning the output string upon encountering a word with a length not smaller than 5, instead you should only return it after processing every word in the string.

  • Custom User Avatar

    Hi, I registered today. My code seems to work, but the test interface does not accept my solution. Maybe I am trying it wrong. Am I missing something? My output is the exact same as the expected result. But it still says failed. Does the checker have a quirk that I don't get?

  • Custom User Avatar

    fundamentals ;-)

  • Custom User Avatar

    It seems that the performance version has looser performance requirements than I expected, because my refsol only performs a single optimization to trim the search space for common subsequences instead of the full DP implementation.

    I've forked my fork, reverting the reference solution.

  • Custom User Avatar

    Remember to not make the refsol a spoiler for the performance version.

  • Custom User Avatar

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

  • Custom User Avatar

    It was fun! But 4 kyu is too much for this kata. This one (https://www.codewars.com/kata/5495bfa82eced2146100002f/python) is more complex, but it's 6 kyu.

  • Custom User Avatar

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

  • Custom User Avatar

    Your solution has two bugs which I had to fix to make it pass.

    Bugs in your solution are not a kata issue.

  • Custom User Avatar
    C Language :
    
    when i test my solution on my pc , it work fine , but fail in test here 
    for example ("20.0.0.10" , "20.0.1.0") , my solution is  246 
    but here i got this : 
    for (start = 20.0.0.10 ; end = 20.0.1.0)
    expected 246 but got 6845
    why ?
    
  • Custom User Avatar

    I've made a fork that addresses all of these along with updating the reference solution to be much more efficient.

  • Custom User Avatar

    Random tests in Haskell could use some work:

    • Almost every pair of random strings contains a longest common subsequence of length 0 or 1, which allows for solutions like this.
    • The error messages for random inputs aren't very helpful:
      • The random strings use characters from the entire range of Char, leading to pairs of strings like "G8\1100651\95058\SUB\\A\b" and "\n\n"
      • When the returned value is shorter than the expected value, the error message will be something like expected: 0 but got: 3, with no indication of what the numbers indicate.
      • When the returned value is not a common subsequence, the error message is expected: True but got: False, which again does not tell the solver what the actual problem is.
  • Custom User Avatar
  • Loading more items...