Short'n'Sweet Python solution, beats 99%
class Solution(object):\n        def lengthOfLongestSubstring(self, s):\n            last, res, st = {}, 0, 0\n            for i, v in enumerate(string):\n     
    class Solution(object):\n        def lengthOfLongestSubstring(self, s):\n            last, res, st = {}, 0, 0\n            for i, v in enumerate(string):\n                if v not in last or last[v] < st:\n                    res = max(res, i - st + 1)\n                else:\n                    st = last[v] + 1\n                last[v] = i\n            return res
[]