Wrote anagram logic

Wrote function to check if words match