c++ solution by normal logic
\nclass Solution {\npublic:\n    string entityParser(string text) {\n        \n        int n = text.size();\n        int sliding;\n        vector<int> marked(n,
```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        \n        int n = text.size();\n        int sliding;\n        vector<int> marked(n, 1);\n        sliding = 7;\n        for (int start = 0; start <= n - sliding; start++){\n            int back = start + sliding - 1;\n            string sub = text.substr(start, back - start + 1);\n            if (sub.compare("&frasl;") == 0){\n                text[start] = \'/\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n        }\n        sliding = 6;\n        for (int start = 0; start <= n - sliding; start++){\n            int back = start + sliding - 1;\n            string sub = text.substr(start, back - start + 1);\n            if (sub.compare("&quot;") == 0){\n                text[start] = \'"\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n            else if (sub.compare("&apos;") == 0){\n                text[start] = \'\\\'\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n        }\n        sliding = 5;\n        for (int start = 0; start <= n - sliding; start++){\n            int back = start + sliding - 1;\n            string sub = text.substr(start, back - start + 1);\n            if (sub.compare("&amp;") == 0){\n                text[start] = \'&\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n        }\n        sliding = 4;\n        for (int start = 0; start <= n - sliding; start++){\n            int back = start + sliding - 1;\n            string sub = text.substr(start, back - start + 1);\n            if (sub.compare("&gt;") == 0){\n                text[start] = \'>\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n            else if (sub.compare("&lt;") == 0){\n                text[start] = \'<\';\n                for (int i = start + 1; i <= back; i++){\n                    // text[i] = \'*\';\n                    marked[i] = -1;\n                }\n            }\n        }\n        int index = 0;\n        for (int i = 0; i < n; i++){\n            if (marked[i] == 1){\n                text[index] = text[i];\n                index++;\n            }\n        }\n        text.resize(index);\n        return text;\n    }\n};\n```
[]