first attempt for anagrams. got TLE.