Loading problem…
You're building a session management system that tracks user activity sequences. You need to find the longest sequence of unique activities without any repetition, which helps identify unique user behavior patterns and generate unique session IDs.
Given a string s, find the length of the longest substring without repeating characters.
lengthOfLongestSubstring("abcabcbb"); // 3 - "abc"
lengthOfLongestSubstring("bbbbb"); // 1 - "b"
lengthOfLongestSubstring("pwwkew"); // 3 - "wke"
lengthOfLongestSubstring(""); // 0This problem models real session management scenarios: