added a solution for the word search problem