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.
Nearly identical to my own solution, a suggestion for you though, try using move() for the result = temp for better eficiency.
could anyone explain what the ++ is doing after the table[std::tolower(x)]++
also it be very nice if someone explained whats going on here
for(auto x: word) result += (table[std::tolower(x)]==1)? "(":")";
and if the first character mismatch is found the loop does not end it self, this is another problem in performans
True, it would be safer and good practice to return pointer to const.
On the other hand, I would never assume any char pointer returned by some function safe for changing unless this is clearly documented for this function. This is C, if you want to make problems you can even cast const to non-const.
Dangerous: "hello world!" is returned as a constant, which can reside in read-only memory. If the caller tried to modify the string -- which should be legal for non-"const" pointers -- it could crash.
This comment is hidden because it contains spoiler information about the solution
Elegant, I'll have to remember this.
This comment is hidden because it contains spoiler information about the solution
If two producers are selling the same product (i.e. the same id), wouldn't that skew the results? I'm having a hard time understanding the difference, but there definitely is one when you compare the output tables.
Thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I don't know :(
Is this mathematically correct ? I don't think it will work for all integers..
This comment is hidden because it contains spoiler information about the solution
Loading more items...