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.
.
.
.
.
Needs random tests
Your test only accept a single way of ordering the letters, which is contrary to what the descriptions says.
Why is the expected result of
""
false
? It's a valid palindrome by itself.Some sample test cases are wrong
This kata has a lot of problems. Maybe it should be deleted.
Not according to the current example tests:
But that's another issue (e.g. the minimal length of a palindrome isn't defined).
If the input is an empty string then it is a valid palindrome string, isn't it?
I'm not sure I understand you, isn't the whole point that the answer be dependent on the input?
In this kata there is no way for an empty string to be returned as a valid palindrome string.
The empty string is a positive answer for an empty string. Would you really prefer the meaning of an answer to depend on input?
Doesn't Ruby have some kind of error mechanism? Either exceptions,
nil
or something else to report errors? In Haskell, you would returnNothing
orJust …
(which areMaybe String
).Either way, are there some guidelines like PEP8 for Ruby? By the way, PEP8 states
None
is fine for non-existing data, so the Python stance probably leads tonil
. Could be helpful for the Ruby section.Returning different data types from a method is bad practice.
Returning an empty string if there is no palindrome would be better than returning false.
Loading more items...