Class Solution
java.lang.Object
g0001_0100.s0003_longest_substring_without_repeating_characters.Solution
3 - Longest Substring Without Repeating Characters.<p>Medium</p>
<p>Given a string <code>s</code>, find the length of the <strong>longest substring</strong> without repeating characters.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “abcabcbb”</p>
<p><strong>Output:</strong> 3</p>
<p><strong>Explanation:</strong> The answer is “abc”, with the length of 3.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “bbbbb”</p>
<p><strong>Output:</strong> 1</p>
<p><strong>Explanation:</strong> The answer is “b”, with the length of 1.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “pwwkew”</p>
<p><strong>Output:</strong> 3</p>
<p><strong>Explanation:</strong> The answer is “wke”, with the length of 3. Notice that the answer must be a substring, “pwke” is a subsequence and not a substring.</p>
<p><strong>Example 4:</strong></p>
<p><strong>Input:</strong> s = ""</p>
<p><strong>Output:</strong> 0</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>0 <= s.length <= 5 * 10<sup>4</sup></code></li>
<li><code>s</code> consists of English letters, digits, symbols and spaces.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
lengthOfLongestSubstring
-