Ad
  • Custom User Avatar

    This is some kind of sport on CodeWars - write code as small as possible, regardless of how readable it is. So don't worry about that.

  • Custom User Avatar

    Please, tell me where are the best practices in that code...The conditions are redundant.

  • Custom User Avatar

    Thanks for explaining!

  • Custom User Avatar

    CW like most social sites suffers from the this fatal disease, that is all.

  • Custom User Avatar

    I'm just wondering as I am scrolling trough one of my python books (which focus on best practice), but isn't this solution breaking the Python principal of "Sparse is better than dense?", because there are more then one Statement on each of those lines? And there are multiple exit points where my source tells me it's more Pythonic to keep the exit points to a minimal.

  • Custom User Avatar
  • Custom User Avatar

    And now you got a neat port in both Python and Ruby.

    I also corrected a couple of typos ("funcionality" and "are passed") in the test.

    Let me know if it is all ok :)

  • Custom User Avatar

    I agree. I thought the kata was bugged until I came to the discussions. At least add it to the list of cases being tested for...

  • Custom User Avatar

    @surtich: A port to python or ruby would not have this issue, since they have arbitrary precision integers.

    Javascript is a poor language to do number theory kata in.

  • Custom User Avatar

    Does it make sense to have string in array? "[1, 1, '2', '2', 3]". I have worked on the solution and now I must change it to take into consideration the strings. Shouldn't be the description be updated?

  • Custom User Avatar

    Make sense now and thank you for your feedback and solving the small issue. Thanks.

  • Custom User Avatar

    Thanks, very interesting resource.

    I have been reviewing the results of my solution. I compared the results with other solutions and the results of this web page.

    Is identical for all numbers less than 299. For larger numbers, each solution produces a different result which also differs from the result of the web page.

    My guess is that JavaScript fails in arithmetic operations with big numbers.

    I changed the test to a number less than 300.

    I hope it helps!

  • Custom User Avatar

    According to http://www.numericana.com/data/partition.htm , it's neither of the two.
    sum(330) = 73653287861850339

  • Custom User Avatar

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