I quit Amazon after two months
10:09
My Last Day at Google
4:59
10 ай бұрын
GPT-4 is OVERHYPED
3:51
Жыл бұрын
Technologies I'm Learning in 2023
9:37
Will AI replace programmers?
4:08
Is FAANG dead?
6:28
Жыл бұрын
Tech Layoffs & Hiring Freezes
5:57
Пікірлер
@swaroopbabaleshwar6072
@swaroopbabaleshwar6072 20 сағат бұрын
does this code works for ip string "wtwosileez" ?
@sucraloss
@sucraloss 20 сағат бұрын
Great video! I still will need to rewatch this a few times I think, but eventually this will make sense. I get the memoization solution at least. For anyone looking for the memoization code, I copied this from the solution section but this will save you a few clicks: class Solution: def climbStairs(self, n: int) -> int: memo = {} memo[1] = 1 memo[2] = 2 def climb(n): if n in memo: return memo[n] else: memo[n] = climb(n-1) + climb(n-2) return memo[n] return climb(n)
@EMdragonKnight
@EMdragonKnight 22 сағат бұрын
Can you do this problem as a Trie?
@byduhlusional
@byduhlusional 22 сағат бұрын
This problem was hard for me to understand but I finally understand it. Essentially, we track the last power of 2 we encountered and in the array we use DP to solve for a given index doing dp[i - last power of 2 encountered]. My solution is like yours, except I make my variables more long/explicit in naming to understand the problem: dp = [0] * (n + 1) dp[0] = 0 curr_power_of_two = 1 previous_power_of_two = 0 for i in range(1, n + 1): if i == curr_power_of_two: previous_power_of_two = curr_power_of_two curr_power_of_two = curr_power_of_two << 1 dp[i] = 1 + dp[i - previous_power_of_two] return dp Table of 2's below: 0 = 0000 2^0 1 = 0001 2 = 0010 2^1 3 = 0011 4 = 0100 2^2 5 = 0101 6 = 0110 7 = 0111 8 = 1000 2^3 = 8, right here we would do 1 + [0-8] 9 = 1001 10 = 1010 11 = 1011 12 = 1100 13 = 1101 14 = 1110 15 = 1111 16 = 10000 2^4 1 + [0-16] 2^16 = 32
@zorxey3189
@zorxey3189 22 сағат бұрын
goat
@lakshmiprasanna7505
@lakshmiprasanna7505 Күн бұрын
very informative and valuable
@daviddong9916
@daviddong9916 Күн бұрын
if Python is S tier, wouldn't Ruby be S tier too?
@Lucas-nz6qt
@Lucas-nz6qt Күн бұрын
Thanks for the amazing explanation! I managed to double the performance by doing this: While iterating s, you can also check if s itself is a palindrome, and if so, you don't need to iterate the other half of it (since s will be the largest palindrome, and therefore be the answer).
@OdablockShort
@OdablockShort Күн бұрын
In the second pass, copy just keeps getting overridden each iteration of the while loop since it's not being stored anywhere, so how is this being saved? I'm very confused with the second pass if someone could better explain to me how it works and how it's being stored.
@sonysherpa3184
@sonysherpa3184 Күн бұрын
incase anyone is having difficulty understanding this. I found this video easier to understand. kzbin.info/www/bejne/m5yppGyEl5eFhLM
@sh4ne-
@sh4ne- Күн бұрын
mans made 320k youtube views reviewing 3rd grade multiplication
@sahilsingh5695
@sahilsingh5695 Күн бұрын
unlocked my joker suit by returning pow(2,x);
@sahilsingh5695
@sahilsingh5695 Күн бұрын
more better approach is transpose the matrix and then swap the outer most cols with each other while going innwards
@vijethkashyap151
@vijethkashyap151 Күн бұрын
I feel using Kahn's algorithm for detecting cycles in the directed graph is the simplest solution for this, even though logically not 100% right as we use indegree in Kahn's algorithm, as soon as I see cycle and undirected graph I solved it with this method. Then I got to know we are supposed to deal with outdegree to deal with independent nodes in this case! Though Kahn's algo works !
@paras9392
@paras9392 Күн бұрын
instead of creating a separate list and updating elements in it based on hashmap values, we can just use a hashset and the get random value as ` return random.choice(list(self.numSet)) `
@kaos092
@kaos092 Күн бұрын
O(26) is polynomial time not linear
@ianokay
@ianokay Күн бұрын
This makes no sense for languages which cannot store a complex object as a hashmap key. I'm really not even sure how it's serializing the object to accomplish that
@fancyAlex1993
@fancyAlex1993 Күн бұрын
Can we not use a hashmap ? Honestly I found the explanation very confusing
@nikhil199029
@nikhil199029 Күн бұрын
do we actually need line number 20? if (i!=minH[0])?
@code_elaborated
@code_elaborated Күн бұрын
My suggestion would be to have a time limit to solve any problem, and once the time is done and you aren't done, better to go with hints and help
@mohammadreza.beygifard
@mohammadreza.beygifard Күн бұрын
I can not change the programming language of this problem on leet code! I click on the language. Is it a bug or should you pay for premium for that?
@bumq5514
@bumq5514 Күн бұрын
Getting into system design and one of the best vids I've seen so far, great in depth detail
@user-ge9bu1he4v
@user-ge9bu1he4v Күн бұрын
Not sure it should be graded as easy problem. Neetcode do really explain every problems in a brilliant way, love it!
@Antinormanisto
@Antinormanisto Күн бұрын
i don't understand
@isaacpak1628
@isaacpak1628 2 күн бұрын
"The Moore optimal solution"
@MrLeyt1125
@MrLeyt1125 2 күн бұрын
Where is Buy or sell III video? We miss it
@sreejah1536
@sreejah1536 2 күн бұрын
Who is watching in 2024??
@rohitchanda8461
@rohitchanda8461 2 күн бұрын
Can somebody provide the Java code?
@satyamsinghal930
@satyamsinghal930 2 күн бұрын
instead of keeping holes in the output array, i created the monotonic stack traversing backwards. LOL. Stupid things stacks make you do
@magnetholik3618
@magnetholik3618 2 күн бұрын
What an amazing story. Thank you for sharing.
@kietack1203
@kietack1203 2 күн бұрын
The best thing I did was subscribing to LeetCode Premium and view the Editorial Answer, they broke down the problems bit by bit, and with the use of debugger and after sometimes, my mind was able to grasp the technique and pattern to be able to solve problems on my own.
@robertmorgan2219
@robertmorgan2219 2 күн бұрын
Amazon has committed crimes against its employees - emotional (rape) assaults.
@robertmorgan2219
@robertmorgan2219 2 күн бұрын
bruh, you describe EXACTLY what many of us: all those feelings we also felt; and we escaped also!!!
@junhuang9047
@junhuang9047 2 күн бұрын
Why does this algorithm work?
@jude2747
@jude2747 2 күн бұрын
best no 1 rule of programming🤣
@m____s
@m____s 2 күн бұрын
def reverseList(head): if (head is None) or (head.next is None): return head newhead = reverseList(head.next) head.next.next = head head.next = None return newhead
@Ebrahim-gj9ko
@Ebrahim-gj9ko 2 күн бұрын
Fuck python .... why dont use really language like C# or Java .
@ghostrecon9101
@ghostrecon9101 2 күн бұрын
how is nlog(n) > to n ? I mean the simplest way to contradict this is to take n = 1
@Chrono294
@Chrono294 2 күн бұрын
Just came from the AWS summit in London and spoke to some of their staff at the speak to an expert table, they can be very toxic and judgmental even when helping random customers. The staff on the other random stalls was very nice though
@AbhijithVMohan
@AbhijithVMohan 2 күн бұрын
Multi source BFS here can be reduced to plain old BFS with single source, if we imagine a dummy node that has 0 cost edges to all the source nodes.
@uncletrashero
@uncletrashero 2 күн бұрын
I tried for a job once, they gave me a single test to complete in a couple days it was supposed to be to get a thing to move to another thing and then back, and the instructions were to not give it discrete instructions on how to do a given thing, so you couldnt just say "turn left, then walk 4 spaces, then right, then walk 2" etc etc. I figured out a way to do it algorithmically where it figured out if it was capable of moving in any direction from its current position at each step and explored the area until it found the thing it wanted, and then explored until it found its way home (marked by a specific set of circumstances) It worked beautifully, the pawn moved around pretty weird but it would do as tasked (get the object, return to home) The company takes a week to get back to me and they say "we arent exactly sure what you did here." and im like, well what did you expect from the test then? and they basically explained that everyone just turns in a program that gives discrete instructions. so i say well thats the basic rule of the test is to NOT do that.. and they were like "well but everyone does." and im like "and you still hire them?" and they say "well yeah we just want to see how hard they try." and i refused to work for that company.
@otakumanushya6006
@otakumanushya6006 2 күн бұрын
i had solved 150+ problems on leetcode but due to some reason i took gap of more than 1 month ,and now i cant remember any thing and intuition is gone im not even able to solve easy level problem , can you help me with this..
@kaos092
@kaos092 2 күн бұрын
This should be a leetcode hard. This is way harder than the water trap question.
@alihezarpisheh8350
@alihezarpisheh8350 2 күн бұрын
Great Video! Thanks ❤
@adityaroyalmatturi2962
@adityaroyalmatturi2962 2 күн бұрын
you can avoid counting the letters in the word as they only appear once
@eliyoung9406
@eliyoung9406 2 күн бұрын
I don't understand why line 12 is necessary
@ChristianoSts
@ChristianoSts 3 күн бұрын
I wish I could understand, gonna implement the code and debug to see what's going on each iteration.
@ashishchoudhary1664
@ashishchoudhary1664 3 күн бұрын
I don't see how this can be a Easy tagged question.
@sohampathak8173
@sohampathak8173 3 күн бұрын
Most honest person i ever heard Hat's off to you!!!
@delsix1222
@delsix1222 3 күн бұрын
why do we start at middle? what if the string was for example "adccdeaba"? The longest palindrom here is "aba", but wouldn't your code give "d" instead, because it is the only case that'd work with s[l] == s[r]? i don't understand what am I missunderstanding