Finding anagrams

Do do you check if two strings are anagrams??

Answer O(n) solution:


bool lookup[26] = {false}
scan the first string and initialize the lookup
scan the second string and check if all the alpahbets are present.

No comments: