1-liner
I build triples (missingPrefixes, negatedLength, word) so I can just take the smallest such triple and extract its word. I add the empty string to the words so 
I build triples `(missingPrefixes, negatedLength, word)` so I can just take the smallest such triple and extract its word. I add the empty string to the words so it's there already and beats any word with missing prefixes. And `accumulate` supports strings, giving me all non-empty prefixes (e.g., for "test" it produces "t", "te", "tes" and "test").\n\n    def longestWord(self, words):\n        return min((set(itertools.accumulate(w)) - set(words), -len(w), w)\n                   for w in words + [''])[2]\n\nDense version:\n\n    def longestWord(self, W):\n        return min((set(itertools.accumulate(w))-set(W),-len(w),w)for w in W+[''])[2]
[]