Check whether a word appears in any of the four cardinal directions in a grid.
Constraints
Example
>>> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]] >>> exists(board, "ABCCED") True >>> exists(board, "SEE") True >>> exists(board, "ABCB") False >>> exists(board, [], "A") False
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints