Palindrome Pairs

Hard

📝 Description

Find all unique index pairs (i,j) where words[i]+words[j] is palindrome

Input Format

List of unique words

Output Format

List of index pairs

Constraints

1 ≤ words.length ≤ 5000

🔍 Sample Input

["abcd","dcba","lls","s","sssll"]
            

✅ Sample Output

[[0,1],[1,0],[3,2],[2,4]]
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run