LC: 425. Word Squares - spiralgo/algorithms GitHub Wiki
The Essence:

A word square matrix is naturally a symmetric matrix.
It means when we try the candidate words starting from the top row to the bottom row, the symmetric order will occur eventually, like in the above picture.
Therefore, we can interpret this situation as a constraint, and a constraint is nothing but a guide to pruning a solution tree.
Details:
As this question asks for all possible solutions to construct a word square and there occurs a constraint that helps us prune the tree, a kind of backtracking technique inevitably comes to mind.
For the detailed explanation and implementation: https://github.com/spiralgo/algorithms/pull/375