Description:
In the field of computer networks, efficient data transfer is crucial. When sending data over a network, it's often necessary to break down large packets into smaller, manageable chunks to ensure reliable transmission. However, each chunk must have a unique identifier to prevent duplication and ensure correct reassembly at the receiving end. The goal is to find the maximum length of consecutive packets that can be sent without repeating any packet identifier.
s
(0 ≤ s.length
≤ 5 * 10^4), representing the sequence of packet identifiers.s
consists of English letters, digits, symbols, and spaces, representing different packet identifiers.abcabcbb
3
bbbbb
1
pwwkew
3