solve anagrams-by-stacks