Easy · Trie · about 15 minutes
Asked at Google, Amazon, Microsoft.
Return the number of index pairs i < j such that words[i] is both a prefix and a suffix of words[j].
i < j
words[i]
words[j]