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.
This comment is hidden because it contains spoiler information about the solution
WTF
Also it doesn't check if doubling will cause int overflow.
This comment is hidden because it contains spoiler information about the solution
std::map is actually O(logn) to find. A hashmap (std::unordered_map) would be what to use for efficiency
I'm not an expert but, IIUC, there are more efficient solutions here. This one is O(n log n) due to sorting. But there are some that use either
std::map
or vectors to keep counts of each letter in each string. Those should be O(n).This comment is hidden because it contains spoiler information about the solution
where is conversion of Boolean to a String?
im new is this solution efficient ?