Solution: Word Search
Let's solve the Word Search problem using the Backtracking pattern.
Statement
Given an 2D grid of characters and word
as a string, we need to determine if the word can be constructed from letters of sequentially adjacent cells. The cells are considered sequentially adjacent when they are neighbors to each other either horizontally or vertically. The function should return TRUE if the word can be constructed and FALSE otherwise.
Constraints:
m
board.length
n
board[i].length
, wherei
m
Access this course and 1400+ top-rated courses and projects.