Did not understand that qusetion

please explain this question

Hello @mayank10,

You have to search in the given MxM grid of characters for the words given initially. You can go in all 8 directions.
For Example -:
4
gitohro qf ejvh i
3
gor
pih
sto

Output should be -:
gitohro i

But For Testcase -:
3
a ab abcd
3
aaa
abc
def
Output should be -:
a ab

Apply dfs.

Hope, this would help.
Give a like if you are satisfied.

what is wrong with the code it does not print ans thing https://ide.codingblocks.com/s/230551

@mayank10
Your code is not complete
Libraries have not been added
Please do that then I can help resolve your query

sir libraries add kr rkhi thi maina bs function bhej diya apko
if you need complete code is here https://ide.codingblocks.com/s/230598

@mayank10
Yrr ye code ab bhi run ni ho rha
Koi java related error hai
I can figure out issue with logic only
Java related issues mein I’m helpless
Ek baar kisi sample pe run kro code before sending
Make sure koi answer aaye wrong hi shi ya TLE ya kuch bhi
Compilation errors nhi par

showing tle

@mayank10
I used the sample test case
and got this error
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1371)
at Main.main(Main.java:60)
Please fix this

Sample test case
2
a aa
2
aa
aa

sir y jo nya link bheja tha isma mena isi test case pr try kra tle a rhi

@mayank10

You had to remove the string from set of strings to find if it is found once

still getting one test case wrong

@mayank10
This test case gave wrong ans
Q : 4
gitohro qf ejvh i
3
gor
pih
sto
A : gitohro i
Try to find once for yourself why

can not find out the bug please tell me the error

@mayank10
I hope you actually tried to find the error
It was a silly mistake
Line 38, 40, 42, 44
You passed last parameter as str instead of ptr
Kindly close this doubt