Domanda di colloquio di Two Sigma

I got asked Word Search II leetcode question