Coding Challenge

Word Search II

Hard
triebacktrackingmatrix

Find all dictionary words present in a board.

Given a board and a list of words, return all words that can be formed by adjacent board traversal.

Examples

Input: board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"]

Output: ["eat","oath"]

Constraints

  • A cell may be used once per path

Preparing your coding workspace...