The DP solution could also be O(nlogn) if we sort the intervals first. Sort by start times then scan through the intervals from end to start and find the first interval on right side that has start time greater than end of current interval (using binary search). Also, the dp array would store the max length of all the subarrays on right so far, not just the length of current chain
@ankurgoswami4441 Жыл бұрын
it's just a variation of Longest Increasing Subsequence (LIS)
@КонстантинОсипов-и8б10 ай бұрын
It is a brilliant solution! I understood it after I tried to do it myself
@MP-ny3ep Жыл бұрын
Great explanation! Thank you!
@kareni75725 ай бұрын
Thanks for the interval solution. It's probably similar to non - overlapping intervals maybe?
@mhdsbk Жыл бұрын
Thanks for the video.. Good one!
@yang5843 Жыл бұрын
Holy shit this is meeting rooms all over again
@swanv951 Жыл бұрын
I always find it difficult to justify whether a greedy approach is correct or not
@introspectiveengineer392 Жыл бұрын
Mind blowing greedy intuition
@shubhamraj25 Жыл бұрын
I don't think it's mind blowing
@bird_in_hat6187 Жыл бұрын
Thanks! But explanation on 9:00 is too intense, bro.
@scykl3 Жыл бұрын
lmfao
@aazzrwadrf Жыл бұрын
Didn't find channel this until recently. I missed a lot of vids..
@reggiehurley1479 Жыл бұрын
why is the solution so f-ing easy but impossible to figure out???