3. Longest Substring Without Repeating Characters 
Longest Substring with At Most Two Distinct Characters | Longest Substring with At Most K Distinct Characters | Subarrays with K Different Integers | Maximum Erasure Value | Number of Equal Count Substrings | Minimum Consecutive Cards to Pick Up | Longest Nice Subarray | Optimal Partition of String
Problem
Given a string s, find the length of the longest substring without repeating characters.
Constraints:
-
0 <= s.length <= 5 * 104 -
sconsists of English letters, digits, symbols and spaces.
1 2 3 | |
1 2 3 | |
1 2 3 4 | |
Complexity:
- Time complexity : O(n).
- Space complexity : O(n).
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |