Easy & Clear Solution Python 3
\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        occ=dict()\n        mx=-1\n        for i in range(0,len(s)):\n        
```\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        occ=dict()\n        mx=-1\n        for i in range(0,len(s)):\n            if s[i] in occ.keys():\n                if i-occ[s[i]]-1>mx:\n                    mx=i-occ[s[i]]-1\n            else:\n                occ.update({s[i]:i})\n        return mx\n```
['Python', 'Python3']