Go one pass map 0ms 2MB
\nfunc maxLengthBetweenEqualCharacters(s string) int {\n    seen := make(map[rune]int)\n    maxlen := -1\n    \n    for i,r := range s {\n        if j,ok := see
```\nfunc maxLengthBetweenEqualCharacters(s string) int {\n    seen := make(map[rune]int)\n    maxlen := -1\n    \n    for i,r := range s {\n        if j,ok := seen[r]; ok {\n            d := i - j - 1\n            if d > maxlen {\n                maxlen = d\n            }\n        } else {\n            seen[r] = i\n        }\n    }\n    return maxlen    \n}\n```
['Go']