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.
closing since it's a question, not an issue
The instructions are not that long, read them again, what you should return is there, how can you pass that? Besides,you have sample tests to see what your function should return. People should read better.
Thank you. I totally forgot it returns unsigned
I was having the same problem, it turned out to be when the vector is empty and we subtract 1 from its size, the comparison in the for loop doesn't work as we expect because v.size() returns an unsigned, and the result of 0 - 1 ends up beign a big positive number instead of -1
Oh man, I love c++ hahah