Coding Challenge

Word Search

Medium
backtrackingmatrix

Find whether a word exists in a board by adjacent traversal.

Return true if the given word can be formed in the board by sequentially adjacent cells. A cell may be used only once in a path.

Examples

Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"

Output: true

Constraints

  • Adjacency is up/down/left/right

Preparing your coding workspace...