← Questions

Products your friends bought that you haven't

0
AmazonCodingLast asked Oct 2025

A user has a list of friends and a list of purchases; each purchase has a product id, an amount and a purchase id, and a product catalog maps product ids to names. Return the names of products that the user's friends bought but the user never did. Discuss duplicates and the cost when users have many friends.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding