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.
Impressive progress! This solution is about 10 times faster than the first. And this is one of the fastest solutions for today.
Fixed.
C (also the case for the previous 32-bit signed comment)
Which language?
Perhaps 'n' should be revealed on a failure in the random tests?
When you get a random test wrong, the test framework apparently reports a truncated 32-bit signed result (my guess) instead of the expected 64-bit unsigned result for the failed test.
Fixed, Thanks.
There's a fixed test with n = 101101291, and the random tests seem to take it even further.
This comment is hidden because it contains spoiler information about the solution
You can do the change of percentage when you want... but calculate with the correct one at the end of the month. Once more, description says:
My solution is not maybe the best but if you have time take a look at it:-)
That gets rid of the ambiguity, thanks! However, I must say that changing the percentage at the end of the month and then calculating with it for that month is borderline criminal. But perhaps expected when bankers and car salsemen are involved.
The honest thing to do is to change the percentage at the start of the month and calculate with it at the end of the month. But maybe that's just me...
Description:
With the example given in the description
nbMonths(2000, 8000, 1000, 1.5) should return [6, 766]
you get for "months", "percentLossByMonth", "available" (rounded):
The thing to understand is: at each step you use the correct percentLossByMonth before doing your calculations. Is that clearer?
It is impossible to know if the bi-monthly loss increase should first be applied at the end of the first or second month. It is thus impossible to get the kata right without luck or trial and error.
Please fix the description.