C++ || EASY TO UNDERSATND || brute force approach
\nclass Solution {\npublic:\n    string entityParser(string text) {\n        unordered_map<string,string> mp;\n        int n=text.size();\n        mp["&quot;"]=
```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        unordered_map<string,string> mp;\n        int n=text.size();\n        mp["&quot;"]="\\"";\n        mp["&apos;"]="\'";\n        mp["&amp;"]="&";\n        mp["&gt;"]=">";\n        mp["&lt;"]="<";\n        mp["&frasl;"]="/";\n        string ans="";\n        for(int i=0;i<n;i++)\n        {\n            if(text[i]==\'&\'&&i+3<n&&isalpha(text[i+1]))\n            {\n                int j=i;\n                string word="";\n                while(text[j]!=\';\'&&(j-i)<=6)\n                {\n                    word+=text[j];\n                    j++;\n                }\n                word+=\';\';\n                if(mp.find(word)!=mp.end())\n                {\n                    ans+=mp[word];\n                    i=j;\n                }\n                else\n                ans+=\'&\';\n            }\n            else\n            ans+=text[i];\n        }\n        return ans;\n    }\n};\n```\n**Please upvote to motivate me in my quest of documenting all leetcode solutions(to help the community). HAPPY CODING:)\nAny suggestions and improvements are always welcome**
[]