Question: Problem: Find the word in board Description: write the code in javaProblem Description ( Illustration ) n = 3 , m = 4 board, ,

Problem: Find the word in board
Description: write the code in javaProblem Description (Illustration)
n=3,m=4 board,
, target word = "NCKU"
output should be true
Problem Description (Illustration)
n=3,m=4 board,
, target word ="NCKK"
output should be false
Given a (n x m) board and a target word, return true if the word can be formed while all characters in the
board are either vertically or horizontally adjacent to each other, else return false.
Restrictions:
Same letter cell could not be used more than once.
The board and target word consists only of uppercase and
Sample Input and Output
Keyboard Input
34// n x m
A R G E // Input of board
T N H O // Input of board
X C K U // Input of board
NCKU // target word
Output
true
Notes:
- Input of board characters
are separated by single
whitespace.
Keyboard Input
34// n x m
A R G E // Input of board
T N H O // Input of board
X C K U // Input of board
NCKK // target word
Output
false
Problem: Find the word in board Description:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!