Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The cell itself does not count as an adjacent cell. The same letter cell may be used more than once.
1). Grid: ab
Word = abab
return 0
2). Grid
[ ["ABCE"],
["SFCS"],
["ADEE"] ]
Word = "ABCCED"
return 1
I cannot get a proper solution to this which handle all cases so if someone can help, it would be very helpful?