Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Please, tell me where are the best practices in that code...The conditions are redundant.
Thanks for explaining!
CW like most social sites suffers from the this fatal disease, that is all.
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.
I did it
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 :)
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...
@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.
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?
Make sense now and thank you for your feedback and solving the small issue. Thanks.
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!
According to http://www.numericana.com/data/partition.htm , it's neither of the two.
sum(330) = 73653287861850339
This comment is hidden because it contains spoiler information about the solution