Python solution || simple and fast || 44ms (99%) || 12.9MB (100%)
If you find it nice, please upvote!\n\n\ndef lengthOfLongestSubstring(s: str):\n    max_len = 0\n    sub = \'\'\n    \n    for l in s:\n        if l in sub:\n  
If you find it nice, please upvote!\n\n```\ndef lengthOfLongestSubstring(s: str):\n    max_len = 0\n    sub = \'\'\n    \n    for l in s:\n        if l in sub:\n            sub = sub[sub.find(l)+1:]        \n        sub += l\n        if len(sub) > max_len:\n            max_len = len(sub)\n            \n    return max_len\n```
['Python']