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.
several things wrong here: if there are no
'o'
in the input, you derefencemalloc(0)
, this is UB; you also assume thatmalloc()
will return zeroed memory, this is not always trueI'm not entirely certain, but I went in and tested this code against a version which used a variable for the string on a very long input, and the version with the variable was noticeably faster, so I would suspect yes.
This comment is hidden because it contains spoiler information about the solution
Expected exception type has been updated.