Easy Python Solution !! Prefix !! Clean Code
Python Code\n---\n\nclass Solution:\n    def longestWord(self, words: List[str]) -> str:\n        map = {}\n        for word in words:\n            map[word] = 
# Python Code\n---\n```\nclass Solution:\n    def longestWord(self, words: List[str]) -> str:\n        map = {}\n        for word in words:\n            map[word] = 1\n        result = ""\n        words.sort()\n        for word in words:\n            flag = True\n            for i in range(len(word)-1):\n                if word[:i+1] not in map:\n                    flag = False\n                    break\n            if flag == True:\n                if(len(result) < len(word)):\n                    result = word\n        return result\n        \n```\n---\n#### *Please don\'t forget to upvote if you\'ve liked my solution.* \u2B06\uFE0F\n---
['String', 'Python', 'C++', 'Java', 'Python3']