C++ #minimalizm
cpp\nint maxLengthBetweenEqualCharacters(string s) {\n    int idx[26] = {}, res = -1;\n    for (auto i = 0; i < s.size(); ++i) {\n        if (idx[s[i] - \'a\'] 
```cpp\nint maxLengthBetweenEqualCharacters(string s) {\n    int idx[26] = {}, res = -1;\n    for (auto i = 0; i < s.size(); ++i) {\n        if (idx[s[i] - \'a\'] == 0)\n            idx[s[i] - \'a\'] = i + 1;\n        res = max(res, i - idx[s[i] - \'a\']);\n    }\n    return res;\n}\n```
[]