Configuration Slot Crossword

You are configuring a rectangular crossword board. Each cell contains a lowercase letter, a blank marker , or a wall marker #. A word may be installed in a straight horizontal or vertical slot.

A slot is a consecutive run of non-wall cells. The word must occupy the whole slot: blank cells accept the corresponding letter, existing letters must match, and the cell immediately before and after the slot must be walls or outside the board. The word may be written in either direction.

Return true when the word fits at least one slot, and false otherwise. The board is not modified.

Examples
Input: [[[" "]],"a"]
Output: true
Hints

Configuration Slot Crossword

You are configuring a rectangular crossword board. Each cell contains a lowercase letter, a blank marker ` `, or a wall marker `#`. A word may be installed in a straight horizontal or vertical slot.