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.
the searching in a string is a little cost ;it's about log (n) or n complexity .thus,your algorithm is big omega of nlog(n).
instead you can use dictionary(HashMap) to make your algorithm kind of O(n)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Making Anagrams
You are viewing a single comment's thread. Return to all comments →
the searching in a string is a little cost ;it's about log (n) or n complexity .thus,your algorithm is big omega of nlog(n). instead you can use dictionary(HashMap) to make your algorithm kind of O(n)