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.
🗿🗿
Your solution does the same you just take up another line to copy the contents of the initial string into a new one.
This comment is hidden because it contains spoiler information about the solution
Whats the point of using auto and then using a trailing return type of int?
Also rare but chad "and" <3.
This works but confuses me a little bit, wouldn't prevIt=it++; be equal to prevIt=it; it++; ? Try running this and you'll see what I mean
I'm having the exact same problem, any hints you can give? Does the browser just not like local static initialization?
This comment is hidden because it contains spoiler information about the solution
I tried using max_element however in the edge case instance of "aa b" it returned "b", why does this work?
My max_element solution only worked in MSVS compiler but failed with Clang on the site.
Key difference was you're iterating over a vector and calculating the value as it iterates but I looped while (ss >> newStr) to calculate the value and put it in an unordered_map<string,int>. Then used max_element on the unordered_map so thats probably why.
This comment is hidden because it contains spoiler information about the solution
insane