3 ms·
The anagram question is a phone screen question, yeah. I believe the histogram solution is better performing than sorting, because storing the histograms as has
by philwelch 13y ago
The anagram question is a phone screen question, yeah. I believe the histogram solution is better performing than sorting, because storing the histograms as hash tables is O(n) on both words while the sorting solution is O(nlogn).