The Sequoia portfolio dashboard receives a chronological array of activity types for a company or portfolio segment. Find the length of the longest contiguous window containing at most k distinct activity types.
A window must contain consecutive elements from the input array. Return 0 when the array is empty.
Implement longest_activity_window(activity_types, k).
activity_types, a list of strings, and k, a positive integer.k distinct strings.def longest_activity_window(activity_types, k):