Practice/Netflix/Movie History Friends II
CodingMust
This is a follow-up to the Movie History Friends problem. Each customer has a list representing the movies they've watched in the order they were viewed. In this variant, two customers are considered "friends" if at least m out of their last k movies are common (not necessarily in the same order or position).
Given a map of customer IDs to their movie watch history, and integers k and m (where m <= k), return all pairs of customer IDs that are friends.
k movies in their history, they cannot be friends with anyoneGiven a dictionary mapping customer IDs to their movie watch history (as a list of movie IDs), find all pairs of customers who share at least m common movies in their last k movies.
` history = { 1: ["A", "B", "C", "D"], 2: ["X", "D", "B", "A"], 3: ["P", "Q", "R", "S"] } k = 3 m = 2
result = find_friends(history, k, m)
`
k movies for each customermk is larger than the history length for all customers?