we n job job schedule startTimei endTimei obtain profit profitiyoure give starttime endtime profit array return maximum profit job subset overlap time rangeIf choose job end time X able start job start time X Example 1input starttime 1233 endtime 3456 profit 50104070output 120explanation the subset choose fourth job Time range 1336 profit 120 50 70example 2input starttime 12346 endtime 351069 profit 20201007060output 150explanation the subset choose fourth fifth job Profit obtain 150 20 70 60example 3input starttime 111 endtime 234 profit 564output 6 constraints1 starttimelength endtimelength profitlength 5 1041 startTimei endTimei 1091 profiti 104