SOUTION - n(0) Time Complexity✅ 100% Beats✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int maxLengthBetweenEqualCharacters(String s) {\n        int res = -1;\n        for(int i=0; i<s.length(); i++){\n            for(int j=i+1; j<s.length(); j++){\n                if(s.charAt(i)==s.charAt(j)){\n                    res=Math.max(res,j-i-1);\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Java']