Anagram maximization