C++ Sliding Window & Hash Map Easy Solution
\nclass Solution {\npublic:\n    int lengthOfLongestSubstring(string s) {\n        \n        unordered_map<char,int> index;\n        int start=0,res=0;\n       
```\nclass Solution {\npublic:\n    int lengthOfLongestSubstring(string s) {\n        \n        unordered_map<char,int> index;\n        int start=0,res=0;\n        for(int i=0;i<s.length();i++){\n            \n            if (index.find(s[i]) != index.end() && index[s[i]] >= start)\n                 start = index[s[i]] + 1;\n            \n            index[s[i]] = i;\n            res=max(res,i-start+1);\n        }\n        \n        return res;\n    }\n};\n```
['C', 'Sliding Window', 'C++']