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.
Personaly I think this should be a complaint with the question, because it is implied that they will be positive, but the type signature/constraints don't explicitly say so.
Using the mathematical properties of arithmetico-geometric sequences, we can express the problem with a nice equation that we just need to solve.
This cuts down the computational complexity magnitude to that of
log()
.The code is clean, although the
rate
is useless ifpercent
is0
, and you could have factoredaug/(1-rate)
into its own variable.I like that solution!