Easiest Solution using map c++
\nclass Solution {\npublic:\n    string entityParser(string text) {\n        map<string,string> g;\n        g["&quot;"]=\'"\';\n         g["&apos;"]="\'";\n    
```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        map<string,string> g;\n        g["&quot;"]=\'"\';\n         g["&apos;"]="\'";\n        g["&amp;"]="&";\n        g["&gt;"]=">";\n        g["&lt;"]="<";\n        g["&frasl;"]="/";\n        auto it=g.find("&amp;");\n        string s;\n        string ans="";\n        int f=0;\n       for(int i=0;i<text.length();i++)\n       {\n          f=0;\n           if(text[i]==\'&\')\n           {\n               s="";\n               for(int j=i;j<i+7;j++)\n               {\n                   s+=text[j];\n                   auto it=g.find(s);\n                   if(it!=g.end())\n                   {\n                       f=1;\n                       ans+=it->second;\n                        i=i+s.length()-1;\n                       break;\n                   }\n               }\n               if(text[i]==\'&\' and f==0)\n              {\n                  ans+=\'&\';\n              }\n                \n    \n              \n           }\n          else\n          {\n              \n              ans+=text[i];\n          }\n             \n    \n           \n       }\n        return ans;\n        \n    }\n};\n```
[]