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
Note: 'abc'
Input → 'bbbbb'
Output → 1
Note: 'b'
Input → 'pwwkew'
Output → 3
Note: 'wke'
Input → ''
Output → 0