Maximum profit non-overlapping jobs

Write codeMedium30 minGoogle style

Your task

You are given jobs as a list of [start, end, profit]. You can do at most one job at a time (a job occupies [start, end), so a job starting exactly when another ends is allowed). Return the maximum total profit of a non-overlapping subset. 1 <= len(jobs) <= 5*10^4, 1 <= start < end <= 10^9, 1 <= profit <= 10^4.

Examples

max_job_profit(jobs: list[list[int]]) -> int
Example 1
Inputmax_job_profit([[1, 3, 50], [3, 5, 20], [6, 19, 100], [2, 100, 200]])
Output200