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.
There doesn't need to be an "f" on 2.0f since it's not a float, it's a double.
Otherwise great!
Most compilers will optimize the code so that size() isn't called every iteration. In theory, you are correct, though.
Suppose size_t i instead of int i would be more correct as well. Iterators probably could have a case here.
This comment is hidden because it contains spoiler information about the solution
You're appending "\n" for the last iteration. Description's output does not end with "\n".
Make sure to check param ranges, and return -1 if invalid.