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.
No. When there are no letters in the string, the result is an empty string. This is when the behaviors are not equivalent:
In the first case, you try to delete a character that does not exist - since the string is empty. This is undefined behavior.
In the second case, you take a substring of the empty string, which is legal because
result.size() - 1
will evaluate to(size_t)0 - 1
akastring::npos
, andsubstr()
specifies:Read several times before understood what was going on. Probably better to emphasize that first the queue is sorted by priorities, then with every "known customer" swapping occurs.