can u explain me the ques. and give me idea usinf rec and back
Crossword from recu and backtr
@saiKDr
taking the sample test case:- we are given two words “a” and “aa” which we need to find in that mm i.e. 22 crossword here.
crossword is :-
0 1
0 | a a
1 | a a
here if yu start from (0,0) then the word made till now is “a” which is needed.
Then it will may go to (0,1) or (1,0) or (1,1) , lets say it goes to (0,1) then the word formed is “aa” is which is also formed.
Then from (0,1) you can go to (1,1) or (1,0) but not (0,1) because it is already visited so if (1,1) is visted then the word is “aaa” so it is not required.
So this way it will recur and backtrack.
It will basically go to one of the possible index in the crossword matrix and make all the recursive choice then after that come back to previous index and go to next possible index.
Let me know if you have any further doubt or need any further explanation about a particular thing or need help with code implementation.
@saiKDr
Here we need to match the from given words that which are possible to make by traversing in the crossword.
So we just need to traverse the crossword matrix in all the possible way and try to make all the words.
Your doubt is not clear to me exactly. So please explain if this doesn’t answer your query.
@saiKDr
about what question are you talking?
i am not able to get what you are saying.
Here maze contains the characters, what do you mean by numbers and their sum?
@sanyamsinghalmnnit sorry i got confused and mixed 2 ques in one. but still i got what u said thanku
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.