Word Squares
b a l l
a r e a
l e a d
l a d yInput:
["area","lead","wall","lady","ball"]
Output:
[
[ "wall",
"area",
"lead",
"lady"
],
[ "ball",
"area",
"lead",
"lady"
]
]
Explanation:
The output consists of two word squares. The order of output does not matter
(just the order of words in each word square matters).Solution
Last updated