5 kyu

Palindrome integer composition

128 of 329KenKamau
Description
Loading description...
Performance
Algorithms
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Very interesting kata, well done.

  • muhammadfathurraiyan Avatar

    This comment has been hidden.

  • blf Avatar

    lost time on a bug due to int overflow, replacement with long eliminated the bug

    all tests Completed in 583ms

  • Emzed89 Avatar

    Wow this one took a long time to solve, I went through lots of iterations until it was optimised enough. Seemed harder than 5kyu to me. I really learned something about performance though! (Ruby)

  • motl Avatar

    Hi, my algorithm performs the 100M (one hundred million) Test in below 0.5 seconds. And yet I receive a 12 second timeout here at codewars.

    Can anyone name me the solution count for 100M, just to be sure? I don't see how there can be that big difference in performance here and locally at mine.

    Regards, Motl

  • RomzesIk Avatar

    This comment has been hidden.

  • rsschool_95dc7772823c9ac1 Avatar

    expected:<...* 7^2 * 11 * 13 * 17[]> but was:<...* 7^2 * 11 * 13 * 17[ ] > So i delete the last symbol of result and get: expected:<2^[3 * 3 * 5]> but was:<2^[15 * 3^6 * 5^3 * 7^2 * 11 * 13 * 17]> What is wrong?

  • vkeziv Avatar

    Tbh took me a while to pass in 12s :D

  • CloudClique Avatar

    My code is too slow. How far off am I?

    Passed: 82 Failed: 0 Exit Code: 1

  • a5zima Avatar

    All I can say for the next fighters: there is a solution with a performance 00.05 sec for 10M test. And this solution is amazing and simple. So don't give up as I did! )) but for now more then 50% from winners have 1dan or 1kyu and first time here I've found more then 5 solutions with cheater tricks )) you will see it later in solutions folder! )) This is very very funny!

  • a5zima Avatar

    I have been working on this kata 2 days. First algorithm I've made for 10 min and it goes through simple tests, but for big test (n=5 mln) I can't made it faster then 10 sec. I will improve it and I like this task, but I think this kata is harder then 5kyu. Also it would be good to accent in the task on test for really big sequences.

  • satyricon Avatar

    Clarification: legitimate sequences would be {1^2 + 2^2}, {1^2 + 2^2 + 3^2}, ..., {2^2}, {2^2 + 3^2}, {2^2 + 3^2 + 4^2}, ..., etc, right ?

    If so, for n = 100 you get 5 and for n = 1000 you would get 16. Not sure if I have understood the explanation correctly. Any suggestions would be appreciated.

  • Mitch281 Avatar

    What's the largest value of n that can be tested in this kata? I passed all five tests in 1048ms (using python) but my code times out for the hidden tests. Any help would be appreciated!

  • Nima155 Avatar

    Hey Could anyone tell me the numbers up to 200 that meet the requirements ... I'm just a bit lost.

  • tanyaba 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?

  • Blind4Basics Avatar

    Hi,

    some suggestions:

    • give the range of the values of n (and maybe the number of tests)
    • add the tag "performances" to the kata

    (I had a hard time on this one... :/ )