Longest Substring Without Repeating Chars

00:00
MediumStringSliding WindowHashMap
AmazonGoogleFacebook

Find the length of the longest substring without any repeating characters.

Examples

Input → 'abcabcbb'
Output → 3
Explanation:

'abc'

Input → 'bbbbb'
Output → 1
Explanation:

'b'

Input → 'pwwkew'
Output → 3
Explanation:

'wke'

Input → ''
Output → 0