Simple Python | String Matching | Easy
Keep track of the indices of the characters in hashmap and do a difference of the maximum\n\n* PLEASE UPVOTE IF THIS METHOD IS USEFUL !\n\n# Code\n\nclass Solut
Keep track of the indices of the characters in hashmap and do a difference of the maximum\n\n* PLEASE UPVOTE IF THIS METHOD IS USEFUL !\n\n# Code\n```\nclass Solution(object):\n    def maxLengthBetweenEqualCharacters(self, s):\n        """\n        :type s: str\n        :rtype: int\n        """\n        dic = dict()\n        maxer=-1\n        for i,val in enumerate(s):\n            if val in dic:\n                diff=i-dic[val]-1\n                maxer = max(maxer,diff)\n            else:\n                dic[val]=i\n        return maxer\n```
['String', 'String Matching', 'Python']