Back to problems

Friends by Last-K Movie Overlap

Algorithm · Netflix · Medium

A streaming service stores each customer's full watch history in time order. You are given: customerIds, an array of distinct customer identifiers, movies, where movies[i] contains the viewing history for customerIds[i], k, the number of final movies used when comparing customers. Customers belong to the same group when the sets formed by their final k watched movies are equal; the ordering within those suffixes is irrelevant. Customers in one such group are treated as…

Checking your access…