Ad
  • Custom User Avatar

    I thought it was too easy, then I thought it was wrong. Now I see that this will take a bit more thinking.

  • Custom User Avatar

    The description says "the Levenshtein distance between two words is the minimum number of single-character edits", how is deleting "na" a single character edit?

    So to go from "nayvyedosf" to "sjxen" you are required:

    1. delete "n"
    2. delete "a"
    3. change "y" to "s"
    4. change "v" to "j"
    5. change "y" to "x"
    6. change "e" to "e" - yeah I get it now
    7. change "d" to "n"
      and then from 8) to 10) delete "osf"

    I was stupid.

  • Custom User Avatar

    To get from "nayvyedosf" to "sjxen" you could delete "na", substitute "yvy" with "sjx", substitute "d" with "n" and delete "osf". That's 9 edits, the test is correct.

  • Default User Avatar

    I agree, I wish they'd show you the test cases. You can simulate it by simply printing the input for each test case before the case fails or passes, and address them one at a time as you pass each successive test case, and the next one prints.

  • Custom User Avatar

    Only lowercase letters allowed. Your solution allows uppercase as well, that's why it fails.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I don't think it's a great idea to hide the test cases, especially if it turns out that the test cases are wrong. Aside from that, hiding the test cases is an act that totally contradicts a TDD approach. The TDD approach is, of course, based on total disclosure of what the tests are about.

  • Custom User Avatar

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

  • Custom User Avatar

    "Unknown Error" is an unknown error. It's usually not kata/solution related. However, your current solution is far too slow, its worst-case runtime is O(n!), and it also needs O(n! * n) space, so you probably run out of memory.

  • Custom User Avatar

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

  • Custom User Avatar

    I got "10 should equal 9" on Test #5 when I submitted my run.

    This is because assertion #5 is wrong. It should say

    test.assert_equals(levenshtein("nayvyedosf","sjxen"), 10)
    

    and absolutely not

    test.assert_equals(levenshtein("nayvyedosf","sjxen"), 9)
    
  • Custom User Avatar

    I opened Firefox :)

  • Default User Avatar

    Which browser do you use? I had simmilar problem in firefox but I opened kata in chrome and I submited solution without problem

  • Loading more items...