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.
Hi,
Unfortunately, that's a duplicate (and there are probably more out there).
...optionally, because it's still in beta, you could stil simply consider a more apt kata title (such as)
Bookending Arrays
with a function name of bookend_array.The function name should be changed because otherwise it's completely misleading / confusing / inaccurate, as there is no mention of shuffling in the description and no actual shuffling required or expected within the algorithm.
To nonetheless prevent invalidation of the solutions submitted so far, you may implement this code in your test suite:
In the example and submit tests,
it
title contains two times the wordreturn
.it
title saysfalse
instead ofNone
.Yes, much better. Although, only the examples show to pick elements from the right. I've been going through the array from left to right all the time, moving elements to the right.
The description says to first rotate the array, then check if it's bookended.
The tests however require the array to be returned as is if it's already bookended without rotation
I made some adjustments based on your feedback. I hope with the adjustments I made to the feedback that it's more clear what I want people to try and do. I also changed the title to this Kata to reflect this clarity.
move each element to the right -> in which order ? Tbh, I don't understand anything at all of this spec. If this is the current standard of a good description, I'm tuning out.
Should be up now
I don't see the changes. Did you republish?
Thanks for the feedback. I agree with returning
None
rather thanFalse
and I implemented random tests.False
if the array can't be shuffled.None
would be more suitable.