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.
C# Translation https://www.codewars.com/kumite/66e96891946b0edf0e00f453?sel=66e96891946b0edf0e00f453
Haskell translation
This comment is hidden because it contains spoiler information about the solution
Actual and expected are swapped in PHP
C
Description says "return an empty array if your array is empty", but tests require null to be returned.
Some of the test cases do not match the problem statement. One simple one that I encountered is:
The problem statement says "write a function to test if the number contains a numerical palindrome" and "numerical palindrome" has excluded cases with leading zeroes in the other kata in this series. In "Numerical Palindrome 3.5", for example, there's a test case for finding all numerical palindromes in
1001331
, and00
is not in the expected result list.The same reasoning should apply in cases like 1050 or 10503, where 050 is not a valid numerical palindrome.
I suspect that the validation code misses this test case, just as my first submission did. It was only on a "train again" to fix my error that I discovered this issue. I see the same omission in most of the accepted submissions, as well, so I don't know how this ought to be fixed.
Random tests does not match with the description in Ruby
Testing for "llufDiEq IeGYgieZneFrB envFAeckiEhjLq KBonDFes. xxPlH xxAouEsz. qrEmE ViENhPc DRsBDxieRkh UBX. MjJsvGWy zBMVbBf. pDsqWNH DIcV hrZeNwcXOMN XgE."
Expected: "Llufdeiq eigygeiznefrb envfaeckeihjlq kbondfes. Xxplh xxaouesz. Qreme veinhpc drsbdxeirkh ubx. Mjjsvgwy zbmvbbf. Pdsqwnh dicv hrzenwcxomn xge."
But from description virus only capitalized some letters, not downcased any; so first letter in "xxPlH" could not be "X" before virus and "x" after virus according to description.
Same issue with words llufDiEq, pDsqWNH and qrEmE
In Ruby reference solution returns true for 100.
So if 010 is a valid numerical palindrome - that should be stated in description, I think.
Otherwise reference solution should be fixed.
And adding test cases for such numbers would be also a good idea
The radnom test cases sometimes fail to verify certain cases, for my solution it sometimes passes everything and sometimes not, so it is obvious that it is a wrong solution, but if you re-run the random test cases, it will pass at some point.
In JavaScript I was able to get a solution which sometimes passed and sometimes failed the random submission tests.
Kata needs fixed submission tests for numbers like
59995
.Hi! Thanks for this Kata ๐ I learned what a palindrome is with this exercise and have to admit, it would be nice to include a single digit number input in the sample tests, like so:
The test cases don't always include a number with (00), such as (400) or (800).
One of my solutions would pass on the anytime the test wouldn't include (00), but would fail if it did.
Julia translation
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai).
Refer to this and this
Loading more items...