Java - Using just StringBuilder, Runtime  > 94.82 % and Memory < 89.56 %
\npublic String entityParser(String text) {\n        public String entityParser(String text) {\n        StringBuilder sb = new StringBuilder();\n        int sta
```\npublic String entityParser(String text) {\n        public String entityParser(String text) {\n        StringBuilder sb = new StringBuilder();\n        int start = 0;\n        boolean flag = false;\n        for (int i = 0; i < text.length(); i++) {\n           char c = text.charAt(i);\n           if(c == \'&\'){\n               start = i;\n               flag = true;\n           }else if(flag  && c == \';\'){\n\t\t\t   //When we encounter "&some text;"\n               sb.append(getOriginal(text.substring(start, i+1)));\n               flag = false;\n           }else if(!flag){\n               sb.append(c);\n           }else if(i == text.length() -1 && flag && c != \';\'){\n\t\t\t   //If we reach at the end and coudn\'t get ";" for previous  "&".\n               sb.append(text.substring(start, i+1));\n           }\n        }\n        return sb.toString();   \n    }\n    \n     private String getOriginal(String s){\n        switch(s){\n            case "&quot;":{\n                s = "\\"";\n                break;\n            }\n            case "&apos;":{\n                s = "\'";\n                break;\n            }\n            case "&amp;":{\n                s = "&";\n                break;\n            }\n            case "&gt;":{\n                s = ">";\n                break;\n            }\n            case "&lt;":{\n                s = "<";\n                break;\n            }\n            case "&frasl;":{\n                s = "/";\n                break;\n            }\n        }\n        return s;\n    } \n    }\n    \n\t//Helper method will return the exact text from the html code.\n     private String getOriginal(String s){\n        switch(s){\n            case "&quot;":{\n                s = "\\"";\n                break;\n            }\n            case "&apos;":{\n                s = "\'";\n                break;\n            }\n            case "&amp;":{\n                s = "&";\n                break;\n            }\n            case "&gt;":{\n                s = ">";\n                break;\n            }\n            case "&lt;":{\n                s = "<";\n                break;\n            }\n            case "&frasl;":{\n                s = "/";\n                break;\n            }\n        }\n        return s;\n    }\n```
[]