Question
In java I have this array = [['y', 'n' ,'o' , 'd' ,'e' 'j'], ['h' ,'s' ,'e' ,'y' 'p' 'k'], ['l' ,'p' ,'h' ,'b' ,'w'
In java I have this array = [['y', 'n' ,'o' , 'd' ,'e' 'j'], ['h' ,'s' ,'e' ,'y' 'p' 'k'], ['l' ,'p' ,'h' ,'b' ,'w' ,'a'], ['l' ,'o' ,'b' ,'w' ,'x' ,'z'], ['w' ,'o', 'b' ,'a' ,'a' ,'i'], ['p', 'l' ,'y' ,'y' ,'c' ,'g']
It represents this word search grid:
y n o d e j h s e y p k l p h b w a l o b w x z w o b a a i p l y y c g
I have this set that contains the words (node, ode, nod, ply, jed, doc, yes, spool, loops, loop, way)
The minimum word length is 3 letters.
I want to search left to right across the grid to find valid words. A word is valid if it meets the minimum word length and is also in the given set. I want to add the words that I found in a list and return them in the order they were found. You should begin at the first letter and check the word length to the end to see if a word is formed. On the top row ['y','n','o','d','e','j'] the words 'nod', 'node', and then 'ode' are found. Then continue to the next letter. For example, this one should return:
nod
node
ode
ply
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started