Ad
  • Custom User Avatar

    I don't think that my c++ solution uses any (advanced) math skills.

    It only uses one optimization that you must have seen (and probably used) in previous katas on level 6.

    It's a bit of a brute force solution, since it does not use the related theorems, but all tests did pass.

    If I look at Firefly2002's solution, I like it much more than the one of mine, but I'm not sure that it has a lower O() complexity thand the one of mine (but it can be much faster for the simple cases).

    But, reading further down in this discussion, I see that slower language might have a harder time finishing the task fast enough... so you might be right.

  • Custom User Avatar

    A bit of googling should help you out with this; there's a specific equation for part of the problem you can use.

  • Custom User Avatar

    Well, do you think it is possible to pass the tests without the math background that i don't have, (i have near no math education) ?

    Is there any clever other trick that would make a python implementation able to pass the tests without timeouts ?

    I don't find any more optimization i could bring to my ignorant "brute force" approach of this problem :(

    Is there some wikipedia math info that i could study that would hint me ?