Given an array of unique strings
words, return all index pairs [i, j] such that words[i] + words[j] is a palindrome.Example 1
Input: words = ["a",""]
Output: [[0,1],[1,0]]
Explanation: a+"" and ""+a are palindromes.
Output: [[0,1],[1,0]]
Explanation: a+"" and ""+a are palindromes.
Example 2
Input: words = ["abcd","dcba","lls","s","sssll"]
Output: [[0,1],[1,0],[2,4],[3,2]]
Explanation: abcd+dcba, lls+sssll, and other pairs form palindromes.
Output: [[0,1],[1,0],[2,4],[3,2]]
Explanation: abcd+dcba, lls+sssll, and other pairs form palindromes.