Champagne Tower - Leetcode 799 - Python

  Рет қаралды 12,731

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 30
@akash-kumar737
@akash-kumar737 Жыл бұрын
I coded after following your explaination and my code is exactly similar. Thanks dude. I have recently started doing Leedcode daily for last 5 days.
@kelvinology4
@kelvinology4 Жыл бұрын
highly recommend all of you to do leetcode 118 - 120 (neetcode has all explanation videos) the structure is pretty similar that all of them are dealing with triangles btw great explanation and your solutions always inspire me, thanks a lot🙏🏻
@bundiderp5109
@bundiderp5109 Жыл бұрын
Great explanation as always. But I found the 44.5 overflow at 4:40 to be very confusing. I am pretty sure it should be 49.5 as 2x 49.5 = 99.
@NeetCodeIO
@NeetCodeIO Жыл бұрын
Yep, my math was way off, sorry about that!
@akhma102
@akhma102 Ай бұрын
Great Explanation. Thank you, Neet!
@il5083
@il5083 Жыл бұрын
I was worrying about some champagne will reach the end first. Didn’t think of processing it row by row is possible. Great explanation, thanks!
@王瀚君-c3j
@王瀚君-c3j Жыл бұрын
It's literally NEET CODE! Thank you
@Harish-rz4gv
@Harish-rz4gv Жыл бұрын
Kinda Pascal's triangle
@J1MKAKA1N
@J1MKAKA1N Жыл бұрын
Simple and elegant, thanks for the effort! Keep it going :)
@tenzin8773
@tenzin8773 Жыл бұрын
Don't think I'll ever be able to solve this in a real interview if I never did this question before :(
@darkcaper703
@darkcaper703 Жыл бұрын
847. Shortest Path Visiting All Nodes :(
@themagickalmagickman
@themagickalmagickman Жыл бұрын
bfs with bitmask instead of set. Look up how to do a bitmask, its actually surprisingly easy. The intuitive approach is to bfs because we want a shortest path, each bfs node will need to maintain a visited set though. Instead of an actual set, we use an integer bitmask. As you know, integers are represented as binary, ex: 00101. If we assign each node to a position in the binary representation, we can mark it visited by flipping the digit from 0 to 1. This yields a unique integer for each visited set. So If I want to mark the 0th node as visited my bitmask looks like this: 0001 (4 nodes total, 0,1,2,3). This yields the integer 1. Set the 0 and 3rd visited? 1001, int = 9. Here is the operation for setting a given bit as visited, bitmask |= (1
@memeproductions4182
@memeproductions4182 Жыл бұрын
did the same, but i basically consider this a BFS where each row is a level of the tree
@anantom251
@anantom251 Жыл бұрын
You are the saviour.
@SD-vk3ko
@SD-vk3ko Жыл бұрын
Thanks lord, we have you!!🙂
@satviksrinivas8764
@satviksrinivas8764 11 ай бұрын
If poured was fixed could there be a DP solution? I'm thinking along the lines that you would have a base case since you know the total amount of champagne.
@VidyaBhandary
@VidyaBhandary Жыл бұрын
Superb Explanation ...
@AmanRaj-yn5pj
@AmanRaj-yn5pj Жыл бұрын
nice way of explaining👍
@anshror2583
@anshror2583 Жыл бұрын
Bro please upload leetcode video daily
@phpostrich
@phpostrich Жыл бұрын
this one was pretty cool
@boisaulit
@boisaulit 8 ай бұрын
Genius.
@phpostrich
@phpostrich Жыл бұрын
another one already wowz
@aazzrwadrf
@aazzrwadrf Жыл бұрын
pretty hard for a med
@vishnusunil9610
@vishnusunil9610 2 ай бұрын
99/2 = 49.5
@danielsun716
@danielsun716 Жыл бұрын
looks like the dp problem
@StellasAdi18
@StellasAdi18 Жыл бұрын
Guess you meant 49.5 and not 44.5 at 5.08 for 100 example.
@SeanBow-fs7rj
@SeanBow-fs7rj Жыл бұрын
ebat' traxatel
@silent7152
@silent7152 Жыл бұрын
i thought it was a dp problem
@haroldobasi2545
@haroldobasi2545 Жыл бұрын
Same, spent forever trying to think of a base case. I guess sometimes the most straightforward solutions are the right ones
@MrKB_SSJ2
@MrKB_SSJ2 Жыл бұрын
lol
Extra Characters in a String - Leetcode 2707 - Python
21:11
NeetCodeIO
Рет қаралды 18 М.
Majority Element II - Leetcode 229 - Python
14:34
NeetCodeIO
Рет қаралды 18 М.
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 15 МЛН
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 4,4 МЛН
Каха и лужа  #непосредственнокаха
00:15
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
Why Coders are Joining THIS Support Group Right Now 😅
2:14
Programming with Mosh
Рет қаралды 9 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 147 М.
Stone Game - Leetcode 877 - Python
22:00
NeetCode
Рет қаралды 31 М.
Detonate the Maximum Bombs - Leetcode 2101 - Python
11:20
NeetCodeIO
Рет қаралды 14 М.
New 21 Game - Leetcode 837 - Python
19:03
NeetCodeIO
Рет қаралды 13 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 197 М.
Knight Dialer - Leetcode 935 - Python
16:39
NeetCodeIO
Рет қаралды 10 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 148 М.
Cherry Pickup II - Leetcode 1463 - Python
24:00
NeetCodeIO
Рет қаралды 16 М.
Shortest Subarray with Sum at Least K - Leetcode 862 - Python
27:57
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 15 МЛН