4 ms·
I'm pretty sure the sort solution would be an order of magnitude faster on any reasonably sized string. Big O's are Big O's : they are irrelevant when n is smal
by epsylon 13y ago
I'm pretty sure the sort solution would be an order of magnitude faster on any reasonably sized string. Big O's are Big O's : they are irrelevant when n is small, and for anagrams we're talking something like n < 45.