37. Longest Substring Without Repeating Characters
MediumSliding window
Return the length of the longest substring of s that contains no repeated characters.
Example 1
Input: s = "abcabcbb" Output: 3 Explanation: "abc"
Example 2
Input: s = "pwwkew" Output: 3 Explanation: "wke"
Constraints
0 ≤ s.length ≤ 5 × 10⁴