30:00
Given a list of unique words, return all pairs of distinct indices (i, j) such that the concatenation of words[i] + words[j] is a palindrome.
1≤words.length≤50001 \leq \text{words.length} \leq 50001≤words.length≤5000
0≤words[i].length≤3000 \leq \text{words}[i].\text{length} \leq 3000≤words[i].length≤300
words[i]\text{words}[i]words[i] consists of lowercase English letters.
All strings in words are unique.
words
Build word map for 5 words
abcd
dcba
lls
s
sssll
No pairs found yet...