Ad
  • Custom User Avatar

    I think I've read something before that javascript sets aren't true or something along those lines and .has should be on average (but not all the time) faster that includes

  • Custom User Avatar

    Please read this first: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution

    And then the error message:

    Traceback (most recent call last):
      File "main.py", line 4, in <module>
        Test.assert_equals(encrypt("This is a test!", 0), "This is a test!")
      File "/home/codewarrior/solution.py", line 5, in encrypt
        return encrypt(text, n)
      File "/home/codewarrior/solution.py", line 5, in encrypt
        return encrypt(text, n)
      File "/home/codewarrior/solution.py", line 5, in encrypt
        return encrypt(text, n)
      [Previous line repeated 995 more times]
      File "/home/codewarrior/solution.py", line 2, in encrypt
        while n < 1:
    RecursionError: maximum recursion depth exceeded in comparison
    

    You have an infinite loop in your code (check that exact input in your IDE). Not a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

    I could never imagine travelling 50km for a tank of gas but I also couldnt imagine travelling 50m even more. I think the distance's measurement should be made clear in the description.

  • Custom User Avatar

    That's the case for most katas. If your function isn't pure, such errors are to be expected.

  • Custom User Avatar

    yeah I used the debugger and noticed this. I understand the difference but still feel a bit cheated because the breif doesnt state the test was gonna be run all in one instance. It merely wants me to solve for number.

  • Custom User Avatar

    You are using a global variable: correct_number, which would just accumulate the data from last function call.

    You should put the declaration inside the function body to store only relevent stuff.

  • Custom User Avatar

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