Simple two pointer approach
\nclass Solution {\npublic:\n    string entityParser(string text) {\n        map<string,char>mp;\n        mp["&quot;"] = \'\\"\';\n        mp["&apos;"] = \'\\\'
```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        map<string,char>mp;\n        mp["&quot;"] = \'\\"\';\n        mp["&apos;"] = \'\\\'\';\n        mp["&amp;"] = \'&\';\n        mp["&gt;"] = \'>\';mp["&lt;"]=\'<\';\n        mp["&frasl;"] = \'/\';\n        \n        for(int i =0;i<text.size();i++){\n            if(text[i]==\'&\'){\n                int j = i;\n                string com ="";\n                while(text[j]!=\';\' && j<text.size()){\n                    com+=text[j];\n                    j++;\n                }\n                com+=text[j];\n                if(mp.find(com)!=mp.end()){\n                    text.erase(i,j-i);\n                    text[i] = mp[com];\n                }\n                \n            }\n        }\n        return text;\n    }\n};\n```
['Two Pointers', 'C']