DEV Community

Discussion on: Solving Algorithm Challenges in Haskell: Anagrams

Collapse
 
thearidg profile image
Aritra Dattagupta

Why not just sort the two strings and check if they are equal?

Collapse
 
theodesp profile image
Theofanis Despoudis

That will also work but the complexity will be higher in general. O(nlogn) vs O(n) using this approach and you will be asked how you can improve it from the interviewer lol.