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.
Thank you, Antonio!
the best
It was stated above in the comments, but to save you some time...
"Because the requirement asks "How many years does the town need to see its population p0 >= p inhabitants?", so you need to repeat the increase of population until p0 < p.
If you repeated the while until p0 <= p, you'd get an extra year in the result (e.g. if p0 = p, you'd get 1, but the expected value would be 0!)."
shouldn't it be <= instead of <?
[] 20 [10, -80, 10, 10, 15, 35] -> left_sum = 0, right_sum = 0, index_value = 20, index=1
[10, -80, 10, 10, 15, 35] 20 [] -> left_sum = 0, right_sum = 0, index_value = 20, index=6
thanks! I got it!
Try reading the posts below, razorpl's one for example.
This comment is hidden because it contains spoiler information about the solution