Saturday, March 24, 2012

Write anagram generator?

Lets use erlang to solve it


-module(anagram).
-compile([export_all]).
anagram([ ]) -> [ [ ]];
anagram(L) -> [[H|T] || H <- L, T <- anagram(L -- [H])].

0 comments:

Post a Comment