function anagrams
-
given an anagram key
ak
, an initial set of partial angramspas
e.g
ak
= "adeor",pas
= #{"a", "are", "dare" ...}- For each partial anagram
pa
inpas
,-
Let
key-diff
be the multiset difference betweenpa
andak
e.g
pa
= "a",key-diff
= "deaor"- If
pas
containskey-diff
, then [pa
key-diff
] is a solution, and we can move on to the next iteration ofpa
- Else,
pa
may be a solution, but we have to check by calling anagrams recursively with the leftovers, that is, the partial anagrams we can make from the multiset difference betweenpa
andkey-diff
- This is where I start to get lost... How do I conver this to a recursive function?
- If
-
- For each partial anagram