Draft
Palindromes
15omarowns
Loading description...
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This is a duplicate of an approved kata :
https://www.codewars.com/kata/58e26b5d92d04c7a4f00020a/
Which is well written, full test suite, etc. and has just minor differences (validation, etc.).
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.
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.
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.The empty string is a positive answer for an empty string. Would you really prefer the meaning of an answer to depend on input?
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.
If the input is an empty string then it is a valid palindrome string, isn't it?
Not according to the current example tests:
But that's another issue (e.g. the minimal length of a palindrome isn't defined).
The return string value is not tested properly.
The sample test cases provided contain syntax errors.
.
Needs an initial test that a string is being returned rather than having the tests fail with a NoMethod error.
The solution template has some comments from another kata.
.
.