Ad
  • Custom User Avatar

    Thanks Chrono, but to be honest this shouldn't really happen since this env is meant for testing anything about the problem not just for uploading a solved version. This is a problem since the answear I return which is the one I use to debug is already sorted so I either have to figure it out by looking at the sorted version or use another env to solve it and then upload it. This really goes against every point of programming since debugging is a very important skill in your programming career. This just looks like lazy writting and not thinking about the people that are gonna solve the question. Thanks for the help!

  • Custom User Avatar

    Getting error while tryinh to litteraly print(1) on python for this kata:
    Probably something wrong in the test pannel, but can't seem to see what's wrong. Some help would be needed. Thanks!

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper
    func()
    File "/workspace/default/tests.py", line 6, in basic_tests
    test.assert_equals(sorted(permutations('a')), ['a'])
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: 'NoneType' object is not iterable

  • Custom User Avatar

    I don't think that's a feature on this site. You can check your proccesing time in top left cornor of the output and then copy the other solution that you found and compare them manualy.Consider that the time will vary from test to test, because in almost any kata you got some random tests that you have to pass and they change for every attempt. Hope I helped you !

  • Custom User Avatar

    Thanks anyway, have a great one!

  • Custom User Avatar

    I think you forgot the [] in the list comprehension for the .join()
    If u want to use a dictionary with all the values you can copy this one:
    dictt = {'a':'1','b':'2','c':'3','d':'4','e':'5','f':'6','g':'7','h':'8',
    'i':'9','j':'10','k':'11','l':'12','m':'13','n':'14','o':'15','p':'16','q':'17',
    'r':'18','s':'19','t':'20','u':'21','v':'22','w':'23','x':'24','y':'25','z':'26'
    }
    The values of the keys are strings so you can use .join() with them without converting them into str. Hope I helped you!

  • Custom User Avatar

    I have started playing with this site for a week I don't want to disturbe anybody, but I saw a lot of comments about this topic and I just said it.
    I will check it again, but I find it strange that a code works for N = 400 and N = 800 and then it doesn't work for 600. Because if it worked for 800 means all the prime primes number I found we re good, but for 600 it s strange. Sorry for bothering you I ll try to rewrite the code and maybe rethink it. Thanks !

  • Custom User Avatar

    Try to see if the python tests are good, because I fail 10 random tests and I have checked everything and it works fine. The test fail random they don't have any coleration between them. Thanks!

  • Custom User Avatar

    If you get a timeout error you need to optimize your code to be faster or even rethink how you approach the problem.
    I think you only have 12000 ms to do 110 tests and the biggest test is n(60000).

  • Custom User Avatar

    It means that all the elements are in order(<) from the smallest one to the largest one and there are no duplicates.

  • Custom User Avatar

    The cache will save over time because you only run the first line of code just once, after that all the test are using by calling the function with different numbers.
    Using the dict CACHE helps u jump over test you have already done in the previous so it s faster.
    Chances are thinked the same way he did but by not using cache you are wasting time on useless tests.

  • Custom User Avatar

    I know I didn't find the best solution, but isn't this just hardcoding the whole point of this kata?

  • Custom User Avatar

    Everytime I attempt I get an error timeout.
    My code is verifing every sum of the divisors of the numbers from m to n and I feel like that it taking too long but I don t have any other ideas can somebody give me a hint?

  • Custom User Avatar

    Thank you !

  • Custom User Avatar

    Can somebody tell me why when I test the code in passes but when I try tu submit it it gives me an execution error timeout?