[ Java  Easy - 3 lines  :  Just One loop using  IndexOf() , lastIndexOf() : 100% ]
```\nclass Solution {\n    public int maxLengthBetweenEqualCharacters(String s) { \n    int max_len = -1;          \n    for ( char ch : s.toCharArray()){\n    
```\nclass Solution {\n    public int maxLengthBetweenEqualCharacters(String s) { \n    int max_len = -1;          \n    for ( char ch : s.toCharArray()){\n        max_len = Math.max(max_len, s.lastIndexOf(ch) - s.indexOf(ch)-1); // to exclude the 2 chars .   \n    }   \n    return(max_len); \n }\n}
[]