Given a list of unique words, return all the pairs of the distinct indices (i, j) in the given list, so that the concatenation of the two words words[i] + words[j] is a palindrome.
- Time : O(nk^2)
- Space : O(branch)
c++
1 | struct Trie { |