Course Schedule III
@awice Sorry didn't read the comments before, just thought you might have missed it.
Smart solution! Thank you!
@baselRus said in C++ 13 lines With Explanation:
you can use priority queue to avoid using iterator / pointer which is error-prone
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.