You are given a string s. A substring is a continuous part of the string. Find the longest substring in which no letter appears two times, and return its length.
Letters taken from different places (a subsequence) do not count. The letters must sit next to each other in s.
Examples
Example 1:
Input: s = "abcbde"
Output: 4
Explanation: The longest good substring is "cbde". Its length is 4. The substring "abcb" is not good because b repeats.
Example 2:
Input: s = "kkkk"
Output: 1
Explanation: Every substring with 2 or more letters repeats k, so the best length is 1.
Example 3:
Input: s = "tmmzuxt"
Output: 5
Explanation: The longest good substring is "mzuxt". Its length is 5.