arrayscomplexitystrings
Anagram checks can avoid sorting
Anonymous
For two length-n strings made of lowercase English letters, count frequencies in a 26-slot array. Increment counts for the first string and decrement for the second; equal strings up to reordering leave every count at zero. This takes O(n) time and O(1) extra space for a fixed alphabet. For arbitrary characters, use a map or sort instead.
0