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.
It is bad practice to change the input or change a copy of the input.
I met exactly same issue as cazyw, then I figured out this was because I changed strarr using shift method, then I updated my solution without changing it all test passed, although this should be test case issue.
Once again I tried some solutions and had no problem.
I have the same problem as cazyw, solving in Ruby. In my code I added some debugging output:
strarr length is: 146
k is 44
✘ Expected: "", instead got: [verylongstring]
All of the other tests are passing, and it seems like this test should not be expecting ""
78 guys passed the kata in Ruby, I just tried and got no problem. I can't understand what happens with your case.
Are you sure that k = 64 and not
-64
? With k = 64 and your array of length 132 your answer is the good one:-)In the random tests (I printed k and strarr.length) the only cases with return "" are when k <= 0. Please keep me informed.
This comment is hidden because it contains spoiler information about the solution
I forgot to ask: which language? Reread the description and see in which cases the result is "". The two cases you gave are almost the same, no? But in the first case your result is "" (I think k is
69
, not-69
) and in the second a very big string, that seems weird.This comment is hidden because it contains spoiler information about the solution
Please fixed tests or random tests? Which input do you have?
Hello, I'm stumped. I'm coding in ruby and it passess all the tests but when I try to submit it always fails on the last test.
The fail message is: Expected: "", instead got: ............a very long string........
But I can't see why it expects "" since the k number is less than the array size but greater than zero.
I'm getting the exact same problem as well. And I can't figure out why.
Edit: Ended up looking at the solutions - I had overcomplicated my code so there were too many calculations being made when the answer was much simpler.