Your question is Sliding Window Coding. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Palantir Foundry pipelines may process an ordered stream of event types from an operational workflow. Given the event types in arrival order, find the length of the longest contiguous subsequence containing no repeated event type.
Implement longest_unique_event_window(events).
events, a list of strings representing event types in chronological order.def longest_unique_event_window(events):