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.
If you look at it from a performance point of view, this solution will benefit when compared with a solution that uses Sequence. During my research, Sequence takes between 5 and 13 seconds, while a solution based on while takes 0 seconds
good job!
This should not be marked as "best practice" as it isn't best practice to write a loop and use mutable vars in Kotlin... Instead code like this is mainly used by straight forward programmers that have not yet seen clear, expressive functional code. ;-) Also I would state that there is a loophole in the whole Kata. Expressing the number of current people as double makes me think: does the author of the Kata want people at the end of every year to be counted as halfs or quarters or instead truncate all "not-yet-one" people? Seems to me, there would be some differences with some test cases...