JAVA  EASY SOLUTION 100% FASTER
\nclass Solution {\n    public int maxLengthBetweenEqualCharacters(String s) {\n        int min[]=new int[26];\n        int max[]=new int[26];\n        for(int 
```\nclass Solution {\n    public int maxLengthBetweenEqualCharacters(String s) {\n        int min[]=new int[26];\n        int max[]=new int[26];\n        for(int i=0;i<s.length();i++) max[s.charAt(i)-97]=i;\n        for(int i=s.length()-1;i>=0;i--) min[s.charAt(i)-97]=i;\n        int ans=Integer.MIN_VALUE;\n        for(int i=0;i<26;i++) ans=Math.max(ans,max[i]-min[i]-1);\n        return ans;\n    }\n}\n```
[]