Python Solutiun via dictionary, Faster than 100%
\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        dict = {}\n        result = -1\n        for i, c in enumerate(s):\n   
```\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        dict = {}\n        result = -1\n        for i, c in enumerate(s):\n            if c in dict:\n                result = max(result, i - dict[c] - 1)\n            else:\n                dict[c] = i\n        return result\n```
[]