Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string s, return the length of the longest substring without repeating characters.
Function signature
func LengthOfLongestSubstring(s string) int
Example
s = "abcabcbb"
output = 3
Constraints
- 0 <= len(s) <= 200_000
sconsists of ASCII characters
Notes
- Use a sliding window with a map of last‑seen indices.
Run tests to see results
No issues detected