Given a 2D board of characters and a string word, return True if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in the word.
def exist(board, word):
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.