Course Schedule III
Smart solution! Thank you!
@awice Sorry didn't read the comments before, just thought you might have missed it.
Oh! add this line in for loop:
if(courses[i] > courses[i]) continue;
How much time does your code take to pass all the test cases ?? Mine took 365ms and I made some modifications so that it does not push every time of the loop and did not calculate heap.size() at the end.
I think here ,
temp-curr+courses[i] <= courses[i] is unneccessary.
Because temp <= course[i-1] <= course[i]
so courses[i] < curr ensures temp-curr+courses[i] <= courses[i]
No one has replied
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.