We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You can use an unordered_map of (string,int) where the signature strings have 26 characters. C++ has a predefined hash for strings.
This works because S has <= 100 characters, so that character counts for each character fit within an 8-bit char.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Anagrams
You are viewing a single comment's thread. Return to all comments →
You can use an unordered_map of (string,int) where the signature strings have 26 characters. C++ has a predefined hash for strings. This works because S has <= 100 characters, so that character counts for each character fit within an 8-bit char.