c# single pass storing min index
Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \nO(n)\n\n- Space complexity:\n Add your space complexity here, e.g. O(n) \nO(n)\n\n# 
# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n# Code\n```\npublic class Solution {\n    public int MaxLengthBetweenEqualCharacters(string s) {\n        int maxLen=-1;\n        Hashtable table=new Hashtable();\n        int len=s.Length;\n        for(int i=0;i<len;i++)\n        {\n            if(table.ContainsKey(s[i]))\n            {  \n                maxLen = Math.Max(maxLen, i-(int)table[s[i]]-1);\n                //Console.WriteLine(maxLen);\n                continue;\n            }\n            \n            table.Add(s[i],i);\n        }\n\n        return maxLen;\n  }\n}\n```
['C#']