Python O(n) solution without Stack using dictionary
\n    def entityParser(self, text: str) -> str:\n        d = {}\n        \n        d[\'&quot;\'] = \'"\'\n        d[\'&apos;\'] = "\'"\n        d[\'&amp;\']  = 
```\n    def entityParser(self, text: str) -> str:\n        d = {}\n        \n        d[\'&quot;\'] = \'"\'\n        d[\'&apos;\'] = "\'"\n        d[\'&amp;\']  = \'&\'\n        d[\'&gt;\']= \'>\'\n        d[\'&lt;\']= \'<\'\n        d[\'&frasl;\']=\'/\'\n        \n        i = 0\n        ans = ""\n        temp = ""\n        \n        while i < len(text):\n            \n            if text[i] == \'&\':\n                temp += text[i]\n                i += 1\n                while i < len(text) and text[i] != \';\' and text[i] != \'&\':\n                    temp += text[i]\n                    i += 1\n                if temp + \';\' in d:\n                    ans += d[temp+\';\']\n                    i += 1\n                else:\n                    ans += temp\n                temp = ""\n            else:\n                ans += text[i]\n                i += 1\n                \n        return ans\n```
[]