Javascript and C++ solutions
Synopsis:\n\nIterate through text one k-th character c at a time, and push each character c onto the answer ans.  Let i and j be the indexes\ncorresponding to t
**Synopsis:**\n\nIterate through `text` one k-th character `c` at a time, and push each character `c` onto the answer `ans`.  Let `i` and `j` be the indexes\ncorresponding to the index in text of the `&` character and `;` character in sequential order.  If the string between `i` and `j` inclusive,\n(ie. `text[i..j]`) is an html entity, then replace `text[i..j]` at the end of the answer with the html entity\'s corresponding character.\nReturn the answer constructed in this manner.\n\n*Javascript*\n```\nlet entityParser = (text, i = -1, j = -1, ans = []) => {\n    let map = new Map([[\'&quot;\',`"`],[\'&apos;\',`\'`],[\'&amp;\',`&`],[\'&gt;\',`>`],[\'&lt;\',`<`],[\'&frasl;\',`/`]]);\n    text.split(\'\').forEach((c, k) => {\n        ans.push(c);\n        if (c == \'&\') i = k;\n        if (c == \';\') j = k;\n        if (i < j) {\n            let N = ans.length - (j - i + 1); // N is the index of text[i..j] (+1 for i..j inclusive)\n            let T = ans.slice(N).join(\'\'); // target \uD83C\uDFAF\n            if (map.has(T)) {\n                ans = ans.slice(0, N); // remove text[i..j]\n                ans.push(map.get(T)); // add corresponding html entity\n            }\n            i = j = -1;\n        }\n    });\n    return ans.join(\'\');\n};\n```\n\n*C++*\n```\nclass Solution {\n    public:\n        using Map = unordered_map<string, char>;\n        string entityParser(string text, int i = -1, int j = -1, string ans = {}) {\n            Map map{{"&quot;",\'"\'},{"&apos;",\'\\\'\'},{"&amp;",\'&\'},{"&gt;",\'>\'},{"&lt;",\'<\'},{"&frasl;",\'/\'}};\n            for (auto k{ 0 }; k < text.size(); ++k) {\n                auto c = text[k];\n                ans.push_back(c);\n                if (c == \'&\') i = k;\n                if (c == \';\') j = k;\n                if (i < j) {\n                    auto N = int(ans.size()) - (j - i + 1); // N is the index of text[i..j] (+1 for i..j inclusive)\n                    auto T = ans.substr(N); // target \uD83C\uDFAF\n                    if (map.find(T) != map.end()) {\n                        ans = ans.substr(0, N); // remove text[i..j]\n                        ans.push_back(map[T]); // add corresponding html entity\n                    }\n                    i = j = -1;\n                }\n            }\n            return ans;\n        }\n    };\n```
[]