MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codinginterview/comments/hlgudn/anagram/
r/codinginterview • u/bparanj • Jul 05 '20
3 comments sorted by
1
we can use hash map and if they are in both string the value of each key will be a minimum of 2 , so if we loop through the map and we find any key that it’s value is 1 then we know it’s not an anagram.
1 u/bparanj Jul 05 '20 What is the advantage of using the Hashmap for this problem?
What is the advantage of using the Hashmap for this problem?
there’s no real adv, it’s just another way to solve the problem.
1
u/jiibo_j Jul 05 '20
we can use hash map and if they are in both string the value of each key will be a minimum of 2 , so if we loop through the map and we find any key that it’s value is 1 then we know it’s not an anagram.