题目描述:
提交:
class Solution: def maxLengthBetweenEqualCharacters(self, s: str) -> int: dic = {} res = -1 for i,v in enumerate(s): if v not in dic: dic[v] = i else: res = max(res,i - dic[v] - 1) return res