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 sets i suppose.
The way I understand what you are trying to do is to store every unique instance of the letter in a set right?
Personally, though sets might seem easier for this problem, i would suggest using sets when you have large sets of values and you want that strict time limit of log N. For this problem though, i wanted a simple algorithm because that makes error finding that much easier.
Happy coding :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
you can use sets i suppose. The way I understand what you are trying to do is to store every unique instance of the letter in a set right?
Personally, though sets might seem easier for this problem, i would suggest using sets when you have large sets of values and you want that strict time limit of log N. For this problem though, i wanted a simple algorithm because that makes error finding that much easier. Happy coding :)