Problem
Ask
Submissions

Problem: Word Search

Medium
30 min
Explore how to apply the backtracking algorithm to solve the Word Search problem. Understand how to determine if a given word exists in a character grid by checking sequentially adjacent cells while using each cell once. This lesson helps you develop problem-solving skills essential for coding interviews using backtracking techniques.

Statement

Given an m x n grid of characters, board, and a string word, return TRUE if word exists in the grid.

The word can be formed by connecting letters of sequentially adjacent cells. The cells are considered sequentially adjacent when neighbors are either horizontally or vertically neighbors. Each cell can be used only once while forming the word.

Constraints:

  • 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 and uppercase English letters.

Problem
Ask
Submissions

Problem: Word Search

Medium
30 min
Explore how to apply the backtracking algorithm to solve the Word Search problem. Understand how to determine if a given word exists in a character grid by checking sequentially adjacent cells while using each cell once. This lesson helps you develop problem-solving skills essential for coding interviews using backtracking techniques.

Statement

Given an m x n grid of characters, board, and a string word, return TRUE if word exists in the grid.

The word can be formed by connecting letters of sequentially adjacent cells. The cells are considered sequentially adjacent when neighbors are either horizontally or vertically neighbors. Each cell can be used only once while forming the word.

Constraints:

  • 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 and uppercase English letters.