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.
Definitely an issue. Without sufficiently large values of
n
, a simple for loop will do. However, larger values ofn
will require values ofr
increasingly close to1
to avoid overflow or underflow.IMHO, this kata would work much better with integer-only inputs, with output taken modulo a large prime. This would eliminate all accuracy concerns.
I believe the reference solution is currently broken. It does not apply the modulus correctly, so it often produces wrong answers for large inputs.
This comment is hidden because it contains spoiler information about the solution
Done, thanks for the tip.
At the end of the month, the newly deposited money does not compound. Only the money existing in the account before the new deposition will compound. In other words, the money compounds before the new deposition.
Looking at your solution, you might want to note that
r
is already given in monthly percentage. Therefore, it should not be divided by12
..
This comment is hidden because it contains spoiler information about the solution
Thanks for the tip, mauro-1. I've now modified the length test to incorporate your suggestion.
This comment is hidden because it contains spoiler information about the solution
Damn, I thought 42 characters was the optimum, but you managed to pull off 41. Well done!
Exact duplicate of https://www.codewars.com/kata/56eb0be52caf798c630013c0/
Beautiful, elegant and readable.
I agree with your suggestion. I've now changed the output type, updated the description, and notified the three authors whose solutions were invalidated.
Technically, the kata is now ready to be approved, but perhaps we should wait for a few more solutions and rank votes. Average assessed rank is
4kyu
, but one could argue that the handling of root multiplicities pushes this closer to3kyu
territory.Your solution to this beta kata was invalidated because of recent requirement changes. Specifically, answers should now be returned as instances of class
Fraction
, not as floats.I apologize for the inconvenience. Feel free to resubmit your solution to reflect this minor specification change.
Loading more items...