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.
fixed
fixed
Approved. Ta!
In JS: I wasn't able to replicate this, but there are several problems with the random tests currently. The tests generate a block of guaranteed "tricky doubles" and a block of random numbers, and then tests each block. However, the random tests incorrectly use global variables and it causes each block of tests to use only one number, so each block tests the same number over and over. Also, in the random block, the "expected" value is always double the random number, even if the random number is a tricky double, which can cause tests to fail incorrectly. My fork fixes all these issues, just waiting on review and approval.
JS fork that fixes several issues:
var
keyword, original tests also would sometimes generate a tricky double and set the expected solution to be double the generated number instead of returning the tricky double) (fixes this issue)JS (at least): random tests are not random: https://www.codewars.com/kata/reviews/5697279e359c07b27600004c/groups/680421b9ceb8289cefa573f3
To check this, it would be very helpful to know which language you attempted, and what was your code (posted with code formatting, in a post marked as spoiler).
Hi, I believe there's a mistake in the test cases for this kata. According to the kata description, if the number is a "tricky double" (i.e., it consists of two identical halves like 8787 or 100100), we should return the number as-is. Otherwise, we should return double its value.
However, my function returned 15 when I passed 15 — and it passed the tests — even though 15 is not a tricky double and should have returned 30.
It seems like the current tests only check if the number has an even number of digits, but not whether both halves are equal.
Please review the test cases to make sure they follow the logic described in the kata.
Thanks!