Merge Intervals - Leetcode 56 - Arrays & Strings (Python)

  Рет қаралды 9,923

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 16
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@scubahick
@scubahick 4 ай бұрын
what drawing software do you use?
@malakggh
@malakggh Ай бұрын
miro whiteboard
@kishc4509
@kishc4509 Ай бұрын
Great work! Wondering why we can't just initiate merged as merged = [intervals[0]] I feel like that's more readable and that way we don't need the "if not merged" check each time. Thanks!
@helloworldcsofficial
@helloworldcsofficial 2 ай бұрын
thanks! Is intervals.sort() not sufficent? and why not?
@Jollez
@Jollez Ай бұрын
I believe because you need to sort based on the 0 index of each pair so you have to declare the comparator
@elijahachiri
@elijahachiri 9 күн бұрын
I hated this problem. I was trying to figure out the solution without sorting and ended up with too much logic that didn’t suit all edge cases. I want to try it again without watching the rest of the video but I’ve already burned too much time
@hamids4550
@hamids4550 20 күн бұрын
why merge[-1]
@Powaup
@Powaup 2 ай бұрын
I just couldnt figure out the need for the .max but examples like this make it necessary: intervals = [[1, 5], [2, 6], [3, 4]]
@ImRafaelPL
@ImRafaelPL 6 ай бұрын
why is it your least favourite?
@robertedwards4401
@robertedwards4401 3 ай бұрын
It's my least because the test cases they give only tell 1/10th of the story.
@Powaup
@Powaup 2 ай бұрын
@@robertedwards4401 they really should just give us an example that is unordered
@dhananjayraina2478
@dhananjayraina2478 Ай бұрын
least favourite for a reason
@GarouNguyen
@GarouNguyen 5 ай бұрын
bro merged[-1][1] not work
@AlgorithmDoctor
@AlgorithmDoctor Ай бұрын
paste your code here, we troubleshoot together
@GarouNguyen
@GarouNguyen Ай бұрын
@ bro do you have experience with api sql orm? I have a project using raw js and html css want to make ot work for comment part and login user
Number of Islands - Leetcode 200 - Graphs (Python)
11:01
Greg Hogg
Рет қаралды 12 М.
Merge Intervals - Sorting - Leetcode 56
10:15
NeetCode
Рет қаралды 169 М.
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Spiral Matrix - Leetcode 54 - Arrays & Strings (Python)
8:32
Greg Hogg
Рет қаралды 10 М.
LeetCode 56. Merge Intervals (Algorithm Explained)
12:57
Nick White
Рет қаралды 91 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 327 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 168 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 180 М.
Merge Overlapping Intervals | Brute, Optimal with Precise TC analysis
22:35
Non-Overlapping Intervals - Leetcode 435 - Python
12:53
NeetCode
Рет қаралды 121 М.