The Codetikki loremasters seek pairs of words that, when stitched together, form a perfect mirror (palindrome). Given a list of words, find all pairs of unique indices (i, j) such that the concatenation of the two words is a palindrome.
Example 1:
Example 2:
Constraints:
1 <= n <= 5000 1 <= word length <= 300 Words consist of lowercase English letters
Tags:
