Assume there’s an interface that allows to attach a set of movies, shows or genres to people, e.g.:
add_person(‘Alice’, [‘DoctorWho’, ‘StarWars’, ‘Sherlock’])
add_person(‘Donna’, [‘DoctorWho’, ‘StarWars’])
add_person(‘Carol’, [‘StarWars’, ‘StarTrek’, ‘GoT’])
add_person(‘Barb’, [‘DoctorWho’, ‘West World’, ‘Sherlock’])
add_person(‘Alexander’, [‘The Back to the Future Trilogy’, ‘The Social Network’, ‘Goldeneye’, ‘Sherlock’])
add_person(‘Diana’, [‘The Gift’, ’The Perks of Being a Wallflower’, ‘Minority Report’, ‘Molly's Game’, ‘StarWars’, ‘GoT’])
add_person(‘Aaron’, [‘The Back to the Future Trilogy’, ‘Goldeneye’, ‘GoT’])
add_person(‘Lily’, [‘Molly's Game’, ‘Sherlock’, ‘StarWars’, ‘GoT’])
Write a function to recommend a show to a person. A good recommendation is a show or movie that they do not already list, but it is listed by people with similar preferences, e.g.:
recommend(‘Lily’) > `The Gift’