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.
Clever problem!
This comment is hidden because it contains spoiler information about the solution
Updated with a proper solution, tested against the unoptimized brute force solution in thousands of cases (which I really should have done from the beginning). Marking as resolved, but please let me know if you run into issues. Also gonna go through and mark most of this as spoilers...
I removed the final example test. There are 50 random tests; I'll reduce that number later tonight.
For now I've changed the test to allow scores better than expected. Still working on a proper solution.
This comment is hidden because it contains spoiler information about the solution
I'll spend the next couple hours trying to come up with something genius, but it might be the case that brute force is the only way to go... could that really be true? Even within brute force, maybe there are optimizations that can bring the time down. If not, I may just have to reduce the complexity of the test cases.
I'll keep an eye on this thread if others want to chime in.
This comment is hidden because it contains spoiler information about the solution
The goal is to find the global maximum; you're doing it right. I actually wasn't aware that the greedy approach could find local maxima... I'll debug once I get home and let you know when it's ready to submit.
If the test case is reporting your score as higher than expected, there's probably a bug in the test. Let me investigate...
I'll expand that part and bold it to draw more attention. Thanks for the input!
I personally find some of the results quite counterintuitive. :)
Totally understandable. I was hesitant to include multi-trick examples in the description because it felt like it was already getting long, but maybe I'd be better off going a little more in-depth? You've written and solved a lot more of these than me, so I'd take any suggestions I could get.
All good. Were the instructions unclear, or was it just the general counterintuitiveness of the problem?
What are you expecting the answer to be? Running the calculation for some answers yields:
{'kickflip': 8 }
.95^8 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 100 * .8^7) = 276.05847627178235
{'kickflip': 7, 'heelflip': 1 }
.95^8 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 101 * .25^ 0) = 329.1510049887904
{'kickflip': 8, 'heelflip': 1 }
.95^9 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 100 * .8^7 + 101 * .25^ 0) = 325.9107428403787
So the expected answer seems to be the optimal one.
Thanks for the heads up! Taking a look...
Loading more items...