C++ code in 9 lines.
int lengthOfLongestSubstring(string s) {\n            vector<int> dict(256, -1);\n            int maxLen = 0, start = -1;\n            for (int i = 0; i != s.le
    int lengthOfLongestSubstring(string s) {\n            vector<int> dict(256, -1);\n            int maxLen = 0, start = -1;\n            for (int i = 0; i != s.length(); i++) {\n                if (dict[s[i]] > start)\n                    start = dict[s[i]];\n                dict[s[i]] = i;\n                maxLen = max(maxLen, i - start);\n            }\n            return maxLen;\n        }
['C++']