...

/

Solution: Word Search

Solution: Word Search

Let's solve the Word Search problem using the Backtracking pattern.

Statement

Given an m×nm \times n 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, where 00 \leq i << m
  • 11 \leq
...
Access this course and 1400+ top-rated courses and projects.