#

Title

Solution

Time

Space

Difficulty

Note

336

Palindrome Pairs

Python

O(n*k^2)

O(n*k)

Hard

Hash Table

425

Word Squares

Python

O(n^2*n!)

O(n^2)

Hard

Premium, Backtracking

212

Word Search II

Python

O(m*n*3^h)

O(t)

Hard

Trie, Backtracking, DFS

421

Maximum XOR of Two Numbers in an Array

Python

O(n log(k))

O(n)

Medium

Trie, Bit Manipulation, Greedy

211

Design Add and Search Words Data Structure

Python

O(min(n,h))

O(min(n,h))

Medium

Trie, DFS

648

Replace Words

Python

O(n)

O(t)

Medium

Trie, String

677

Map Sum Pairs

Python

O(n)

O(t)

Medium

Trie

208

Implement Trie (Prefix Tree)

Python

O(n)

O(1)

Medium

Trie

#425) Given an array of unique strings words, return all the word squares you can build from words. The same word from words can be used multiple times. You can return the answer in any order. A sequence of strings forms a valid word square if the kth row and column read the same string, where 0 <= k < max(numRows, numColumns). For example, the word sequence ["ball","area","lead","lady"] forms a word square because each word reads the same both horizontally and vertically.