Simple C++ solution
\nclass Solution {\npublic:\n    string entityParser(string text) {\n        m["&quot;"] = "\\"";\n        m["&apos;"] = "\\\'";\n        m["&amp;"] = "&";\n   
```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        m["&quot;"] = "\\"";\n        m["&apos;"] = "\\\'";\n        m["&amp;"] = "&";\n        m["&gt;"] = ">";\n        m["&lt;"] = "<";\n        m["&frasl;"] = "/";\n        for(int i = text.size()-4;i>=0;i--){\n            string sub4 = text.substr(i,4);\n            string sub5 = text.substr(i,5);\n            string sub6 = text.substr(i,6);\n            string sub7 = text.substr(i,7);\n            if(m.count(sub4)) text.replace(i,4,m[sub4]);\n            if(m.count(sub5)) text.replace(i,5,m[sub5]);\n            if(m.count(sub6)) text.replace(i,6,m[sub6]);\n            if(m.count(sub7)) text.replace(i,7,m[sub7]);\n        }\n        return text;\n    }\nprivate:\n    unordered_map<string,string> m;\n};\n```
[]