A Supermicro BMC processes a sequence of event codes from a server's sensor stream. Given the sequence, find the length of the longest contiguous segment that contains no repeated event code.
Use a sliding window approach that runs efficiently in one pass. The event codes are compared for exact equality, and the original order must be preserved.
Implement longest_unique_segment(events).
events, a list of strings representing Supermicro BMC event codes.0 when events is empty.def longest_unique_segment(events):