easy peasy python solution using sorting and set
\tdef longestWord(self, words: List[str]) -> str:\n        #sort the words, then keep in the set and check for nextWord[:-1] in the set\n        words.sort()\n 
\tdef longestWord(self, words: List[str]) -> str:\n        #sort the words, then keep in the set and check for nextWord[:-1] in the set\n        words.sort()\n        st, res = set(), "" #res == result\n        st.add("")\n        for word in words:\n            if word[:-1] in st:\n                if len(word) > len(res):\n                    res = word\n                st.add(word)\n        \n        return res
['Ordered Set', 'Python', 'Python3']