Ad
  • Default User Avatar

    Thanks for checking. I'm closing this issue. Regards, suic

  • Default User Avatar

    This is a CW glitch. Your solution was tested against an old version. I've added tests for edge cases and modified the date range for random tests. Please check. Regards, suic

    P.S.: If you see the same problem. Push the Reset button and try again.

  • Custom User Avatar

    Description:
    Backwards Read Primes are primes that when read backwards in base 10 (from right to left) are a different prime. (This rules out primes which are palindromes.)

    From the kata description.

  • Custom User Avatar

    In this kata, 11 is not a backward read prime. It needs to be different prime from original prime.

  • Custom User Avatar

    It just doesn't work like that... There's no magic here. Maybe the last assertion text is with nil arrays and they don't get displayed in console (IDK how go handles that). I edited your code and it works, you just need to read what error messages tell you and react to them.

    As a little hint: you can replace 6 if statements at top with 2: 1 that deals with nil values and 1 that deals with different array lengths. Good luck.

  • Custom User Avatar

    You could've replied to your original question... Now there's massive wall of text, which no one likes to see :/

    The problem with your code is how you're handling cases when 2 arrays are empty or when 1 array is empty and other one isn't. You should remove most of those if blocks at the top and rewrite them to cover all scenarios, you're almost there. (you can do that in 1 or 2 lines max)

    And by the way, 2 empty arrays should return true.

  • Custom User Avatar

    That test expects false, both in sample and final tests.

  • Custom User Avatar

    Are you sure those arrays are not manipulated (before logging)? I don't really know Go, but I just solved it and tests seem fine.