Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Ahh, I felt rather stupid for not knowing what was up here for a few minutes. I did not realise infinite iterators would be tested.
Attempting to use something like this doesn't work on the number iterator:
for i in range(len(xs)):
if arr[i] = item and i != len(xs) - 1:
return arr[i+1]
Pretty close.
in the Python version of this kata, you have to deal with infinite sequences, so your
list()call never terminates.it does make the Python version not adapted for 8 kyu, but this has already been raised
hello, suggestions are meant for proposing improvements to the kata, not giving hints to other users (that would be a spoiler)
The problem is that you are given iterators which can be infinite but your first step is to copy them into a list. That will never terminate. Try to find a solution which only uses the iterator (so called "lazy").
One could add to the description that you have to handle infinite sequences.
Can't solve the Kata couse i keep getting timeout errors in testrun. Don't understand whats causing the error cause my code
looks quite similar to de solutions..
You're asking for it. Fine. You earned it.
OK, it's 8kyu because it's underrated, and the intent of the OP is that it should handle infinite sequences.
The kata should be checked in all languages to see if it tests with those ( if it doesn't, add that; if that can't be done, remove the translation ), and the description should include that little factoid - and specs of what "sequences" will be actually tested with.
Just so you know, on a short string ("Success") this solution executes in 49 ns, and your solution in 189 ns.
Asymptotic complexity is not so relevant with short inputs.
I'ts a nice kata but i think its bit more complicated than 8kyu. its like 7 or 6
"help pls" is not a valid kata issue. The issue is in your code.
I ran your code snippet, and it runs into allocation errors (because you're trying to create an array from an infinite iterator). This is a bit more difficult than 8kyu in JS, and you need to handle infinite sequences correctly.
This comment is hidden because it contains spoiler information about the solution
Time complexity? I prefer to think of it as giving my computer a thorough workout!
VSCodelacks sufficient testing coveragetry comparing your failed test cases for a commonality
Solution for JS passes all tests in VSCode, but crashes when attempting it here? Why?
Loading more items...