Word Search

Try to solve the Word Search problem.


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.


  • m == board.length
  • n == board[i].length, where 00 \leq i << m
  • 11 \leq m, n 6\leq 6
  • 11 \leq word.length 15\leq 15
  • board and word consist of only lowercase or uppercase English letters.
  • The search is not case-sensitive.


Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy