Skip to content
Discussion options

You must be logged in to vote

We need to design a movie rental system that supports searching for available movies, renting movies, returning rented movies, and generating a report of the currently rented movies. The system must efficiently handle these operations while ensuring that the results are sorted according to specific criteria.

Approach

  1. Initialization:

    • Store the price of each movie at each shop in a dictionary (prices).
    • Track the rental status of each movie at each shop using a dictionary (rented).
    • For each movie, maintain a min-heap (movieHeaps) that contains all copies (as [price, shop] pairs) available for that movie. This heap helps in efficiently retrieving the cheapest available shops during search …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@basharul-siddike
Comment options

@mah-shamim
Comment options

mah-shamim Sep 21, 2025
Maintainer Author

Answer selected by basharul-siddike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested hard Difficulty
2 participants