Easiest Java Solution!
Update: Leetcode Update the "&gt;" testcase, so this solution may not be applicable, but at lease you should remember there is a String.replace(String source, S
**Update: Leetcode Update the "&amp;gt;" testcase, so this solution may not be applicable, but at lease you should remember there is a String.replace(String source, String target) method to replace the source string by the target string!**\n\n*One of the most straightforward solutions:*\n\n```\n    public String entityParser(String t) {\n        if (t.length() < 4) {\n            return t;\n        }\n        StringBuilder sb = new StringBuilder();\n        for(int i = 0; i < t.length(); i++) {\n            if(i + 6 <= t.length() && t.substring(i, i + 6).equals("&quot;")) {\n                sb.append(\'"\');\n                i += 5;\n            } else if(i + 6 <= t.length() && t.substring(i, i + 6).equals("&apos;")) {\n                sb.append(\'\\\'\');\n                i += 5;\n            } else if(i + 5 <= t.length() &&t.substring(i, i + 5).equals("&amp;")) {\n                sb.append(\'&\');\n                i += 4;\n            } else if(i + 4 <= t.length() && t.substring(i, i + 4).equals("&gt;")) {\n                sb.append(\'>\');\n                i += 3;\n            } else if(i + 4 <= t.length() && t.substring(i, i + 4).equals("&lt;")) {\n                sb.append(\'<\');\n                i += 3;\n            } else if(i + 7 <= t.length() && t.substring(i, i + 7).equals("&frasl;")) {\n                sb.append(\'/\');\n                i += 6;\n            } else {\n                sb.append(t.charAt(i));\n            }\n        }\n        return sb.toString();\n    }\n```\n\n*Old Post before my update: *\n\nHope you guys will not feel struggling again when you see such a question again! Here we go:\n```\n\t    public String entityParser(String text) {\n\t        text = text.replace("&quot;", "\\"");\n\t        text = text.replace("&apos;", "\'");\n\t        text = text.replace("&amp;", "&");\n\t        text = text.replace("&gt;", ">");\n\t        text = text.replace("&lt;", "<");\n\t        text = text.replace("&frasl;", "/");\n\t        return text;\n\t    }\n```\n\nBased on the Problem Statement: HTML entity parser is the parser that takes HTML code as input and replace ***ALL*** the entities of the special characters by the characters itself. \n\n**I think we should follow the given explanation and output when you are in the real interview.**
[]