LeetCode Coding Challenge - Add Two Numbers (2019)

preview_player
Показать описание
LeetCode coding problem. This question is commonly asked by Amazon and Google according to LeetCode.

#keeponcoding #tech #programming

SUBSCRIBE TO THE CHANNEL:

-----------------------------------

*** SUPPORT ME ON PATREON ***

-----------------------------------

Рекомендации по теме
Комментарии
Автор

Wow. You're the first person who actually gave their own answer, instead of just copying the solution provided by leetcode, and acting as if it was theirs. Bravo

mikeyknight
Автор

I liked the fact that you explained it exactly how a interview should be. just perfect.

shyammuppidi
Автор

The first channel which clearly explained each and every step .Thanks a lot sir. Keep helping us.

psthakur
Автор

Great explanation! It helped me understand the problem better than reading the provided Leetcode solution

Ramentop
Автор

from the title i felt very smart and thought: its just return a + b;

brxnni
Автор

I'm having trouble understanding what you're trying to say at 13:55 . At what point does resultHead ever get updated to point to something other than 0? Does updating resultIterator somehow update resultHead?

JoseGutierrez-gdfp
Автор

Quick question, what stands in my way of converting given linked lists let's say to strings then ints then adding and refilling the linked list, during interviews?

nopenah
Автор

Good explanation and a clever solution bro.. Keep it up..

rajeevsingh
Автор

Thanks bro great explanation, but I have one comment time complexity should be O(max(m, n)), because you loop in both lists in same time

remonibrahim
Автор

I didn't even understand what the fucking problem was until I saw your explanation, thank you very much :)

GuitarreroDaniel
Автор

what is the "if(carry){ sum++}" doing? he says check from the previous value if there is a carry, what is the previous value? like 6 + 4 for the second resultHead node?

kevinrodriguez
Автор

Isn't the time complexity just O(n), where n is the number nodes in the longer list? Like O(n + m) doesn't necessarily make sense, since the runtime is bound by the longer list.

MW
Автор

Thank you so much, keep it up, you are great

MohammedBakheet
Автор

Correct me if wrong but wont the program not work with lists that have mismatched lengths due to the fact that the if statements for (p1 == null) and (p2==null) are inside a while loop that checks to make sure (p1 != null || p2 != null). This means the code will never be executed. Regardless, this video was very helpful and informative.

enjoipanda
Автор

Dummy_head means null to a head node, I just learnt why they call it a dummy head

felixliu
Автор

Best Explanation of Add 2 Numbers on Youtube :)
Upload More videos - > HARD LEVEL

yuvrajbansal
Автор

so I'm guessing that two number added together cannot be 20 or over for this particular code?

laughoutmeow
Автор

mine says ListNode is not defined and i got a warning: comparison between null and non-pointers p1 and p2

Sportsman
Автор

bro for me its showing null pointer exception

prajjwalmishra
Автор

I think O(n+m) = O(n). But nice video!

wxq
join shbcf.ru