Question Prompt (1 of 1)
You are running a classroom and suspect that some of yourstudents are cheating by sharing answers as single words hidden in2D grids of letters.
A particular grid contains at most one word. The word may startanywhere in the grid, and consecutive letters can be either belowor to the right of the previous letter.
The input will consist of a word and a grid. Print the locationof the word in the grid as a list of “row column†coordinates, eachon its own line. If the word does not appear in the grid, justprint “Noneâ€.
Example input:
catnip c r c a r s a b i t n b t f n n t i x s i i p t
Example output
0 2 0 3 1 3 2 3 3 3 3 4
Clarifications:
- The word will always appear in the grid exactly 0 or 1times.
Starter code is provided for the following languages: Java, C,C++, JavaScript,
If you wish to use a different language, please write asolution
that reads from STDIN and writes to STDOUT. To obtain startercode,
change the language to one of the previously mentionedlanguages.
Public test 1
Input:
car
c r c r a c a b i t n b t f n n t i
Expected Output:
None
Public test 2
Input:
car
c r c c a r a b i t n b t f n n t i
Expected Output:
0 3 0 4 0 5
Public test 3
Input:
carsick c r c a r s a b i t n b t f n n t i x s c a t n x s d de a s q w x s p
Expected Output:
None
Public test 4
Input:
catnap c r c a r s a b i t n b t f n n t i x s c a t n x s d d ea s q w x s p
Expected Output:
3 2 3 3 3 4 3 5 4 5 5 5
Public test 5
Input:
catnip c r c a r s a b i t n b t f n n t i x s i i p t
Expected Output:
0 2 0 3 1 3 2 3 3 3 3 4