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.
OP solved it, closing
Your tons of code make me laugh. +1 Clever for making my day, big brain :)
I was talking about
.capacity
, not the other one.Function .rfind reads the "str" string and returns position of "ending" string from 0 to (.size - 1) or returns -1 if nothing is found. It's very useful to check where should be "ending" and form right condition.
Why? There is really no reason to do that. I've never seen that method ever used in any kata, for obvious reasons (if you read its documentation). It probably has its uses elsewhere.
Ty. I know that there are other methods, but I want complete this code by this method. I used size and length too, but it was completely usefull.
No need to repeat the same question. Capacity might not work as you expect (for example it returns 15 for "abc"). There are other better methods for that purpose.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
As I know, length is for string, but is a vector, that means dinamic array of strings. I used names.size()