Oracle Interview Question

Word search problem on LeetCode