Given a 2D board of characters and a list of words, find all words that exist in the board.
Rules for word existence:
Constraints:
Examples:
// Example 1:
const board1 = [
["a", "b", "c", "d"],
["s", "a", "a", "t"],
["a", "c", "k", "e"],
["a", "c", "d", "n"],
];
const words1 = ["bat", "cat", "back", "backend", "stack"];
console.log(findWords(board1, words1));
// Output: ["cat","back","backend"]
// Example 2:
const board2 = [
["x", "o"],
["x", "o"],
];
const words2 = ["xoxo"];
console.log(findWords(board2, words2));
// Output: []