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.
my comment was 2 years ago, i think it was originally meant for someone that wasnt checking for empty first (or size>0). its fine if checking size/empty first and is well defined. again, it was 2 years ago, so i dont recall exactly at that time ;).
Why? I see on cppreference that it has been in standard since C++11. Since the solution has already tested if the result is empty, I think there won't be any undefined behavior here.
Yes, actually we have a problem right here. Just checked and std::string does not terminates in NULL, I thought that was the case.
Yes, index is out of range and can lead to undefined behavoir. Should really be checking for i>0 and i<fight.size()-1
This comment is hidden because it contains spoiler information about the solution