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.
Just wow
thanks for your help.it solved
round off will solve the problem
Yes I think so , writing problem.
A problem with your code is not a kata issue, please read this: https://docs.codewars.com/training/troubleshooting/
This comment is hidden because it contains spoiler information about the solution
You need to do that every year, not only at the end. If you only do that at the end, you'll get the wrong result. akar-0 already told you that:
And that's what this shows:
@Chrono79 I know there's no fractional population, but read again. Even if I rounded down 1214,22 to 1214, don't you agree that 1214 = 1214? And, in that test, 1214 is p. So if the idea was that p0 equals or surpasses p, 1214 (rounded down from 1214,22) would suffice.
Yes there's a problem with the kata's writing. I was wondering why I was getting that error. I have try to debug it but to no avail.
There is no fractional population, read the kata's description again.
You must round down for each year.
Test case saying the result is supposed to return 4 years is, in fact, 3 years. The input is (1000, 2, 50, 1214). If you do the math "by hand", in the third year you would have 1214,222 people. Even if you round down to 1214, 1214 is still equal to 1214. So, there's a problem with the kata's writing. It should say that the expected years is greater than 1214(p) instead of greater OR equal to... That or the expected result for this test should be 3 instead of 4.