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

    "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.

  • 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

  • Custom User Avatar

    Please format your code with backticks (```) or indentation (4 spaces):

    ```python
    def helloWorld():
      return "Hello, world!"
    ```
    

    or

        def helloWorld():
          return "Hello, world!"
    

    That being said, did you have a look at the solutions? The one voted for best practise looks pretty much the same, altough more concise.