Two Sigma interview question

I got asked Word Search II leetcode question