Ad
  • Custom User Avatar

    fixed

  • Custom User Avatar

    fixed

  • Custom User Avatar

    Approved. Ta!

  • Custom User Avatar

    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.

  • Custom User Avatar

    JS fork that fixes several issues:

    • Updated to Node 18 (fixes this issue)
    • Fixed random tests (previously, random tests tested the same number over and over due to the misuse of the 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)
    • Shuffled random tests so appearance of tricky doubles were more randomized (previously random tests would test a block of tricky doubles followed by a block of actual random numbers) (fixes this issue)
    • increased number of random tests to 100
    • general cleanup of test code
  • Custom User Avatar
  • Custom User Avatar

    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).

  • Custom User Avatar

    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!