Ad
  • Default User Avatar

    Thanks for your post!
    Note: the kyu is given by the one who approves the kata, not the author.

  • Custom User Avatar

    I think the hardness of this kata goes up pretty harshly (2.5 or 3 kyu?) for those without the math insight asked in this task. (I'm one of them.)
    Also quite telling that despite the 5 year old kata, only 200 finished it with JavaScript as of now :).
    But it was very pleasing to see that it can be solved even with a wasteful brute-force partition generating solution.
    (Though barely. My code can't handle n = 50 in time, and even 49 is pretty tough with +32million loops...)
    I didn't see any others solve it the crazy way I did. Shameful points for creativity I guess?

    In case anyone ever comes looking here for hints:
    1- You have to either dive into the math or come up with a creative brute-force approach
    2- If you go with the latter, you might have to optimize your code pretty hard.
    Get ready to try all your performance ideas and keep testing the code.
    Any kind of loop is both your best friend and worst enemy.

    Thanks for the tough lesson, g964 :).