Search
⌘K

Leetcode 336. Palindrome Pairs

Given an array of unique words, return all ordered index pairs (i, j) such that words[i] + words[j] is a palindrome. The optimal solution relies on detecting palindromic prefixes/suffixes and reverse lookups (e.g., hash/trie) to run in O(total length of all words).

Asked at:

Airbnb


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late March, 2025

Airbnb

Senior

Comments

Your account is free and you can post anonymously if you choose.