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.
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).It doesn't change anything, this approach would work fine.
But there's a caveat: if the first string is really long it'll be slow.
im new is this solution efficient ?
shtup clyde
What happens if str2 is longer than str1
How do you learn how to do this?
Hello sir is there a pdf version available for the Java Documentation?
Is there a PDF Version of the Java Documentation available?