Last active
February 12, 2024 06:05
-
-
Save fenilgandhi/47fd9e2596ee68313023cdc3fdf61c25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
You are given with two lists, popular_products_ids and viewed_products_ids | |
- The first list is the list of ids of all popular products that any user would like to view | |
sorted on their popularity in descending order | |
- The second list is a list of ids of all products that this user has already viewed. | |
- Write a function get_fresh_products which return the products which are not yet viewed by | |
the user while maintaining the sorted order of popularity in an efficient manner | |
""" | |
popular_products_ids = list(map(id, range(50000))) | |
liked_products_ids = list(map(id, range(10000))) | |
# Add function definition here | |
def get_fresh_products(popular_products_ids, liked_products_ids): | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment