Anagram bipartition