Maximum Length of Pair Chain - Leetcode 646 - Python

  Рет қаралды 7,735

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 15
@akshaykhatri2292
@akshaykhatri2292 7 күн бұрын
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
@ankurgoswami4441 Жыл бұрын
it's just a variation of Longest Increasing Subsequence (LIS)
@КонстантинОсипов-и8б
@КонстантинОсипов-и8б 10 ай бұрын
It is a brilliant solution! I understood it after I tried to do it myself
@MP-ny3ep
@MP-ny3ep Жыл бұрын
Great explanation! Thank you!
@kareni7572
@kareni7572 5 ай бұрын
Thanks for the interval solution. It's probably similar to non - overlapping intervals maybe?
@mhdsbk
@mhdsbk Жыл бұрын
Thanks for the video.. Good one!
@yang5843
@yang5843 Жыл бұрын
Holy shit this is meeting rooms all over again
@swanv951
@swanv951 Жыл бұрын
I always find it difficult to justify whether a greedy approach is correct or not
@introspectiveengineer392
@introspectiveengineer392 Жыл бұрын
Mind blowing greedy intuition
@shubhamraj25
@shubhamraj25 Жыл бұрын
I don't think it's mind blowing
@bird_in_hat6187
@bird_in_hat6187 Жыл бұрын
Thanks! But explanation on 9:00 is too intense, bro.
@scykl3
@scykl3 Жыл бұрын
lmfao
@aazzrwadrf
@aazzrwadrf Жыл бұрын
Didn't find channel this until recently. I missed a lot of vids..
@reggiehurley1479
@reggiehurley1479 Жыл бұрын
why is the solution so f-ing easy but impossible to figure out???
Minimum Penalty for a Shop - Leetcode 2483 - Python
14:58
NeetCodeIO
Рет қаралды 10 М.
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 36 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Longest String Chain - Leetcode 1048 - Python
15:34
NeetCodeIO
Рет қаралды 10 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 853 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 330 М.
Maximum chain length of pairs || Dynamic programming
12:54
Techdose
Рет қаралды 19 М.
Flip String to Monotone Increasing - Leetcode 926 - Python
15:05
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 303 М.
Count Ways to Build Good Strings - Leetcode 2466 - Python
14:09