@SeanB: Instead of multiplying number just add them. Adding won't cause a big value for stack overflow or something.(e.g A=1, a=1: b=2, B=2...so on.) Rule of Association in maths. That would do. However even for multiplying or adding we have to split the string which will involve some complexity, therefore that might not make the whole operation o(n).

@SeanB, thats good idea, adding to that: we can map a prime number for each alphabet. if any string has same multiplied product then both should be anagram. For example: Map the first 26 prime numbers to "abcd....xyz" "1, 3, 5, 7, 9, 11, 13, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97" now consider the anagram: "cinema" and "iceman" the product of the two numbers will be same. Since we use prime numbers, the factors should be same. so its proved that both are anagrams. To check overflow: 97 is for the char "z", and usual word size is 10. So, Math.pow(9, 10) is 73742412689492830000 and which still finite.

@Jimmy: There is a small flaw in your assumption. Let's say we take the prime number sequence as 1, 2, 3, 5, 7,,, assigned to A, B, C, D, E etc Your assumption would give out the same answer for "BC" and "D". But these two are two not anagrams. So i guess i better approach would be to multiply the numbers.