class Solution:
def maxValue(self, meeting, value):
intervals=meeting
if not meeting:
return 0
l=len(intervals)
intervals.sort()
res=value[0]
tune=[[intervals[0][1], value[0]]]
for i in range(1,l):
temp=value[i]
for j in range(i):
if tune[j][0]<=intervals[i][0]:
temp=max(value[j]+value[i], temp)
tune.append([intervals[i][1], temp])
res=max(tune[i][1], res)
return res
Hi there ,
Can you help me with a problem
https://www.lintcode.com/problem/meeting-room-iv/description
This question I solved using dp by finding maximum length of non-overlapping interval giving priority to maximum value
below is my python code.
But it only passed up 31% , can you provide some hints whats going wrong?