Back to problems

Movie History Friends

Algorithm · Netflix · Easy

CodingSoftware Engineer Movie History Friends Every customer has a sequence of movies, listed in the order they watched them. Two customers are friends precisely when the final k entries in their histories are identical, including both the movies and their ordering. Given a mapping from customer IDs to their viewing histories, together with an integer k, produce every pair of customer IDs that qualifies as friends. Notes: A customer whose history contains fewer than k movies…

Checking your access…