Cinema Shows
Learn this problemProblem statement
SDE II
A prominent media company (AMZ MGM) has partnered with select theaters to showcase exclusive video content, including feature films, episodic series, live performances, and more.
You are given an integer n, representing the number of scheduled screenings. Each screening has a start time, duration, and expected audience size, which are provided as integer arrays start, duration, and volume, respectively.
Your task is to determine the highest possible total audience size while ensuring that no two selected screenings overlap. Two screenings are considered non-overlapping if one fully concludes before the next one begins.
Function
cinemaShows(start: int[], duration: int[], volume: int[]) → int
Complete the function cinemaShows in the editor below.
cinemaShows has the following parameter(s):
int start[n]: an integer array denoting the start times of each showint duration[n]: an integer array denoting the durations of each showint volume[n]: an integer array denoting the volumes of each show
Returns
int: an integer denoting the maximum possible volume that can be received
Examples
Example 1
start = [10, 5, 15, 18, 30]duration = [20, 12, 20, 35, 35]volume = [50, 51, 20, 25, 10]return = 76
Example 2
start = [1, 2, 4]duration = [2, 2, 1]volume = [1, 2, 3]return = 4Constraints
1 ≤ n ≤ 10^51 ≤ start[i] ≤ 10^91 ≤ duration[i] ≤ 10^91 ≤ volume[i] ≤ 10^3
More Amazon problems
- Secure Maximum DeliveriesOA · Seen Jul 2026
- Find Median from Data StreamONSITE INTERVIEW · Seen Jul 2026
- Handwritten SigmoidPHONE SCREEN · Seen Jul 2026
- Handwritten SoftmaxPHONE SCREEN · Seen Jul 2026
- Koko Eating BananasONSITE INTERVIEW · Seen Jul 2026
- Loyal Customers Across Two DaysONSITE INTERVIEW · Seen Jul 2026
- Maximum System Memory CapacityOA · Seen Jul 2026
- Package Delivery SystemOA · Seen Jul 2026