Ad
  • Custom User Avatar

    Apparently the test cases are buggy so the problem might not be your solution.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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