Word Squares

Given a set of words (all same length), find all word squares that can be formed. A word square is where the i-th row's word is the same as the i-th column's word.

Examples
Input: ["area","lead","wall","lady","ball"]
Output: [["ball","area","lead","lady"],["wall","area","lead","lady"]]
Hints

Word Squares

Given a set of words (all same length), find all word squares that can be formed. A word square is where the i-th row's word is the same as the i-th column's word.