O19
Longest Substring Without Repeating Characters
Problem Statement & Objective
Given a string s, find the length of the longest substring without repeating characters.
Function Signature (Python)
length_of_longest_substring(s: str) -> intInput & Output Contract
Output Rule:Length integer of the longest non-repeating substring.
System Constraints
0 <= s.length <= 5 * 10^4
s consists of English letters, digits, symbols and spacesExample Execution Walkthrough
s = "abcabcbb"
longest substring is "abc" -> length 3
s = "bbbbb"
result: 1Example Test Scenarios (3)
Example 1
Input:
["abcabcbb"]Expected Output:
3Example 2: Tekrar
Input:
["bbbbb"]Expected Output:
1Example 3: 'wke'
Input:
["pwwkew"]Expected Output:
3