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.
I made 2 approaches that flattened from bottom up that matched the examples but was failing and I couldn't see why.
It would be nice if you add the last test to pass this kata to the description so it becomes obvious what you want a top down approach.
This comment is hidden because it contains spoiler information about the solution
How can I make this better?
Disabled reverse/reverse! in String and Array for ruby and reverse() in JS for a bit of added complexity
Why?
worst...kata...evar
In addition to a few predefined tests, I've also added tests against a random string generator 50 times which are guaranteed to produce valid palindromes for JS and Ruby implementations to avoid 'lucky guesses' against the set tests.
Added a test that incorporates underscores now. Thanks for the feedback!
right, because writing your own character class would be such a challenge.
Needs a test that includes an underscore (
'_'
), to thwart all the tests that use\w
or\W
in their regex. :-)(The
\w
character class is defined as[_a-zA-Z]
.)I like the part where I flipped the thing right down and reversed it.