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.
funny how everyone was thinking the same thing
I have the same problem
No, and see the example in the kata's description, at the end of the third year, you have a population of 1213.
In the case for p0 = 1000, percent = 2.0, aug = 50 and p = 1214, the correct return would be 3 and not 4 as expected in the tests. I performed the table test and in the third year the approximate number of 1214 is obtained. As the challenge wants the number of years needed to obtain a population greater than or EQUAL to p, then in the third year this is already obtained.
p0 percent aug p inhabitants years inhabitants < p
1000 2.0 50 1214 1070 1 TRUE
1070 2.0 50 1214 1141 2 TRUE
1141 2.0 50 1214 1214 3 FALSE -> Break
The percentage is a positive number, so the population is always increasing.
The label "issue" is not for advice, it's for actual issues. Use question label next time.
Start by printing inputs as shown here: https://docs.codewars.com/training/troubleshooting/#print-input and also read the description very carefully (or read 100 other related posts on this discourse section).
Your code is returning 3, but it should return 4 instead.
thank you
This comment is hidden because it contains spoiler information about the solution
you need to use the spoiler flag when discussing code solutions / methods. i have added the flag to your comment
This comment is hidden because it contains spoiler information about the solution