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.
I like this solution:
Python 3.8 should be enabled.
This comment is hidden because it contains spoiler information about the solution
yeah, your solution seems to be much faster than the ones that got upvoted
It's even worse, as the required Python sorting for the main array is not an ascendant sorting. For 10, for example, it requires the subarrays to go: [..., [1, 9], ..., [4, 6], [5, 5], [10]]
Yep, ran it a couple of times, doesn't pop up any more.
I think it's fixed. Check it and let me know. Thanks a lot.
To be clear, my solution was accepted, it was only the logs showing a
sum_
which was clearly not thesum_
that was being tested for. It doesn't even always do this, and the problem doesn't have to do with cases where the expected answer actually is 0. It's in the cases where it's in fact looking for something like 18 with 3 dice, it will log that it's looking for 38. But it will still accept the correct answer. So the issue, if any, is in the print function, I'd imagine.Something strange happened. 96 people solved it without problem. I checked my solution and tests code and both give 0.0 for the probability in a different Ide.
Probability = 0.0
sum_ = 38
dice_amount = 3
Probability = 0.0
sum_ = 33
dice_amount = 4
Probability = 0.0
sum_ = 29
dice_amount = 3
I'm wondering what's going on.
Python
Which language please?
This comment is hidden because it contains spoiler information about the solution
Much pythonicity. Such power.
Great educational Kata, I came at it without knowledge of graph search algorithms, but seem to have naturally stumbled onto something in the spirit of Djikstra's. Could someone have a look at my solution and comment how much slower it is compared to par and why?
string len in python is O(1)
Loading more items...