[LeetCode][3. Longest Substring Without Repeating Characters] Two Pointers: Sliding Window with HashSet
By Long Luo
This article is the solution Two Pointers: Sliding Window with HashSet of Problem 3. Longest Substring Without Repeating Characters.
Intuition
We can just simulate the process.
Using a Sliding Window from left to right of the string, and a HashSet to make every character is unique in the sliding window.
1 | public static int lengthOfLongestSubstring(String s) { |