Haskell : http://www.codewars.com/kumite/5b8a14ad3f65632ad900003b?sel=5b8a14ad3f65632ad900003b
Haskell : http://www.codewars.com/kumite/5b8a040e3f65632ad9000013?sel=5b8a040e3f65632ad9000013
Haskell : http://www.codewars.com/kumite/5b875d5aced43caafc00003f?sel=5b875d5aced43caafc00003f
Haskell : http://www.codewars.com/kumite/5b873f7d75b546c950000120?sel=5b873f7d75b546c950000120
Can you kindly get rid of the stupid error message that you wrote. That'd be much appreciated :)
Haskell : http://www.codewars.com/kumite/5b86dc259795329281000085?sel=5b86dc259795329281000085
It likely is counting dups, for example there are a bunch of 55's, and a 1155.
What does span as argument mean? Please give me an example...
"Too easy" is not a suggestion. Unless it's a duplicate (which should be raised as an issue).
This comment is hidden because it contains spoiler information about the solution
So badly explained I won't even try to do it.
My friend @dastevens gave me the explanation. My solution works on the sample test and not the random test because I changed num without knowing it. Why ? In my solution, I wanted to work on a copy of num, so I wrote :
var numInc = num
(This would not be the case if we worked on strings, since strings can never be modified).
And this is why, we think, the sample tests are passed but not the random ones. Let's say that the author wrote a function, the solution of the kata, named "kataSolution()" ;
the sample tests do not run kataSolution(). The expected result is already provided. The tests only compare this expected result with that of incrementer(). In that case everything's OK.
but in the random tests, kataSolution() has to be run, to calculate the solution. And it seems that it is run AFTER incremeter(), which modified num. So kataSolution is run on a modified num. Example :
num = [1, 2, 3]
myIncrementer(num) = [2, 4, 6] , but it also transforms num in [2, 4, 6].
so kataSolution(num) is in fact kataSolution(myIncrementer(num)) ! That's to say [3, 6, 9] instead of expected [2, 4, 6].
We suggest changing the description to say do not change the input array, and add a test that fails if the input array is modified.
Thanks to the author and to dastevens to make me realize this noticeable feature...
Exactly the same problem for me : sample tests all OK, random tests leave the array unchanged. Thanks for your help !
I cant understand why the number '115555' has 7 palindromes. 11,55, 555, 5555 anything else?
No problem, for others reference, you can only rearrange 1212 to the palindromes 1221 or 2112. Other katas of this series test for palindromes included in the number, not this one.