🚀 Day #23
Picture a grid of letters, an
m x n board brimming with possibilities, and a treasure trove of target words waiting to be discovered. Your mission is to uncover every word from the given list, words, hidden within this board. But there’s a
twist: each word must be pieced together by traversing sequentially adjacent cells—
connected either horizontally or vertically—without retracing your steps or revisiting the same cell in a single word. The challenge lies in navigating this labyrinth of letters to reveal all the words concealed in its depths.
example:
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"]
input: ['w', 'o', 'r', 'd'],
['b', 'a', 't', 's'],
['e', 'n', 'e', 'p'],
['g', 'h', 'i', 'q']]