Python Solution easy
\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        \n        d = defaultdict(list)\n\n        for i,char in enumerate(s):
```\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        \n        d = defaultdict(list)\n\n        for i,char in enumerate(s):\n            d[char].append(i)\n\n        temp = -1\n        for indices in d.values():\n            diff = indices[-1] - indices[0] - 1\n            if diff > temp:\n                temp = diff\n                \n        return temp\n```
[]