Python3 one pass O(n) solution - Large Substring Between Two Equal Characters
\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        last, ans = {}, -1 \n        for i, c in enumerate(s):\n            if
```\nclass Solution:\n    def maxLengthBetweenEqualCharacters(self, s: str) -> int:\n        last, ans = {}, -1 \n        for i, c in enumerate(s):\n            if c not in last:\n                last[c] = i\n            else:\n                ans = max(ans, i - last[c] - 1)\n        return ans \n```
['Python', 'Python3']