Ad
  • Custom User Avatar

    I've included an explanation of array lengths tested. I hope it's helpfull.

  • Custom User Avatar

    Tests take and return strings now.

  • Custom User Avatar

    All done! Random tests are added and tests take and return str values. Thanks ;)

  • Custom User Avatar

    All done!

    • random tests are added after the fixed ones
    • tests take and return str values

    Thanks for the comments!

  • Custom User Avatar

    When testing large numbers, all my results have one extra palindrome. For example, when testing n= 1000000 is 60, n=5000000 is 78 and so on. I’ve checked each palindrome one by one and they all are correct. For example for n= 1000000 last one is 964469 (5662 + 5672 + 5682), for n=5000000 last one is 3187813 (12622, 1263**2). Is there an error in test results for large numbers?

  • Custom User Avatar

    But you still iterate over every digit. So if the number passed is as large as 1000 digits this solution could be very slow.

  • Custom User Avatar

    Great Kata! It made me think a lot. Though, I cannot pass the test because my results do not have a '-' between units and tens. i.e. 'twenty two' is not equal 'twenty-two'. Now I need to modify my code to add '-' in correct places in order to pass the test. Not good!

  • Custom User Avatar

    This code does look short, though if you try it on a large data it takes quite a while to return the result