425 Word Squares
425. Word Squares
1. Question
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).2. Implementation
3. Time & Space Complexity
Last updated