Job Calendar Profit Problem
Job Calendar Profit Problem — ExecCode Hard DSA Practice
Solve the Job Calendar Profit problem on ExecCode. Free online hard DSA practice in DP. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Jobs have start, end, profit. You may take a subset of non-overlapping jobs (touching at an endpoint is allowed: end == next start). Maximize profit. Return the maximum profit. You are given: starttime — starts endtime — ends, end > start profit — positive profits Return integer profit. Taking nothing yields 0 but profits are positive so you take at least one if n>=1.
Examples
Input {'starttime': [1, 2, 3, 3], 'endtime': [3, 4, 5, 6], 'profit': [50, 10, 40, 70]}; Output 120. Input {'starttime': [1, 2, 3, 4, 6], 'endtime': [3, 5, 10, 6, 9], 'profit': [20, 20, 100, 70, 60]}; Output 150. Input {'starttime': [1], 'endtime': [2], 'profit': [5]}; Output 5
Constraints
Jobs that only touch at a time point do not overlap You cannot take a partial job
Practice Job Calendar Profit free on ExecCode. Browse DSA problems, topic map, and placement guides.