Anagram Detection
Two strings are anagrams when they contain the same characters with the same frequencies, assuming the same normalization rules. The efficient approach is to count character frequencies in one string and decrement them using the second string.
Time complexity: O(n).
Auxiliary space: O(k), where k is the character set size or number of distinct characters.
Sorting both strings provides O(n log n) time but is usually less efficient.
Case sensitivity, whitespace, Unicode normalization, and punctuation should be specified.