Any ideas? Perhaps finding a path in the graph?
The first line of input contains the word that you need to find on the field. The word length is from 1 to 25 characters. The next 5 lines contain 5 characters each - the field of philvord. The field size is always 5 by 5. Output Y or N depending on whether the word is found or not. The letters in the word can be placed as you like, except on the diagonal
Entered:
WORD WRDYM FOHHH NLKWO RRRRR ABBCD Brought: Y