gary@interview:~/interview/coding/336-palindrome-p….md$
$ cat ./coding/336-palindrome-pairs.md
[Coding]

336. Palindrome Pairs

────────────────────────────────────────────────────────────

336. Palindrome Pairs

class Solution:
    def palindromePairs(self, words: List[str]) -> List[List[int]]:
        
        def isPalindrome(word):
            left = 0
            right = len(word) - 1

            while left < right:
                if word[left] != word[right]:
                    return False
                left += 1
                right -= 1
            return True

        res = []
        i = 0
        
        while i < len(words):
            j = 0
            while j < len(words):
                if i != j:
                    word = words[i] + words[j]
                    if isPalindrome(word):
                        res.append([i, j])
                j += 1
            i += 1
        return res
$ ls ./coding/ | grep -v 336-palindrome-pairs
265. Paint House II256. Paint House143. Reorder List1762. Buildings With an Ocean View
← cd ../codingcd ~