Ad
  • Default User Avatar

    Ok, thx! Learned something today!

  • Default User Avatar

    I can't seem to get my code through the fourth submit test for python, although the given output is exactly the same as what is requested. Could you have a look at that?

  • Default User Avatar

    As a comment on my solution I explained how this problem can be solved without going through the entire series from i = 1 to n, just by applying a limited amount of equations. This results in a solution which needs less calculation power (I got around 2300 ms when going through the series, and around 1400 ms with the 'optimized solution'.) As you gave the suggestion to optimize the solution, this problem would just get that extra edge, and increase the difficulty slightly, if such an optimized solution was actually needed in order to fulfill the kata.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    The test would be more supportive if it would print what was given as a test if it failed. Further, just in my opinion, a book starts at page 1, and not page 0.

  • Default User Avatar

    As a matter of fact, you don't need to analyse beyond the square root of the given integer. In that case, just add the result of the division as well (if it is not the same, at least). I would propose to test quite large numbers as well, in order to demand more efficient code for large numbers.