Python solution via sorting and hashset with explanation
First sort the list by length then alphabetically. Then, iterate through the sorted list. If the length of word is 1, just add to hashset. If length larger than
First sort the list by length then alphabetically. Then, iterate through the sorted list. If the length of word is 1, just add to hashset. If length larger than one, we need to check whether its [:-1] part in set or not. So all the content in hashset are strings meet our requirements. In order to meet the output requirement, we first sort alphabetically then by length. Pick the one on the top.\n```\nclass Solution(object):\n    def longestWord(self, words):\n        """\n        :type words: List[str]\n        :rtype: str\n        """\n        if not words:\n            return ""\n        \n        words.sort(lambda x, y: len(x) - len(y))\n        words.sort()\n        \n        hashset = set()\n        \n        for i in range(0, len(words)):\n            if len(words[i]) == 1:\n                hashset.add(words[i])\n            elif words[i][:-1] in hashset:\n                hashset.add(words[i])\n        \n        if not hashset:\n            return ""\n\n        if len(hashset) == 1:\n            return ""\n       \n        res = list(hashset)\n    \n        res.sort()\n        res.sort(lambda x, y: len(y) - len(x))\n        \n        print res\n        \n        return res[0]\n```
[]