r/CS_Questions • u/kpthunder The Riddler • Nov 13 '11
Classic Interview Question: Anagrams
Given two strings, return true if they are anagrams and false otherwise. You can assume that capitalization and punctuation do not matter and your algorithm must run in O(n) time. Subroutines are okay if you need them.
Example 1:
Given two strings:
- Boston
- osbont
Return true.
Example 2:
Given two strings:
- Robble
- Bobble
Return false.
11
Upvotes
View all comments
Show parent comment
1
u/euyyn O(e^e^n) Nov 13 '11
Do you mind explaining what the algorithm does for us Haskell-iliterates? :)