Add Two Numbers - Leetcode 2 - Python

preview_player
Показать описание


0:00 - Visual Explanation
5:30 - Coding Solution

Leetcode 2
#amazon #interview #leetcode

Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

hearing "hey guys i'm still unemployed so let's solve a leetcode problem today" and knowing you became a software engineer at google is so real and inspiring bro, thanks

e-raticartist
Автор

"hey guys i am still unemployed so lets solve a problem " this is savage bro

rohitkumarsinha
Автор

I get so inspired/motivated when you mention unemployment in your old videos because of where you ended up

chair_smesh
Автор

"hey guys i am still unemployed so lets solve a problem " this one cracked me up because right now all your efforts paid off and look back, we all have been there..ah what a journey!!!

bigrat
Автор

I've been watching your solutions for a while now and I'm just so happy that I finally started to solve problems like the way you do. Thank you so much!!

mehmetnadi
Автор

That beginning took me by surprise, instantly made my evening better. Thanks

snoudoubts
Автор

So simple, thank you. I was casting the linked list values to strings and reversing them, then casting them back to ints and adding them... needless to say I was making spaghetti.
Your example is very clean!

Eftahhh
Автор

Awesome, I love how you dealt with all the edge cases without cluttering the code

syafzal
Автор

Excellent! Clear and plain explanations, and it's so much cleaner when hand mark-up is by pen instead of by mouse. :)

This is linked in LeetCode as "optimized solution explained" on the problem itself, but it'd be faster to take:
carry = val // 10
val = val % 10

...and make it instead:
carry = 1
val = val - 10

The modulus approach is fantastic for expanding our algorithm to support adding up three or more arrays, but in our use case carry will always be 0 or 1.

philhamlin
Автор

Congratulations that you are now employed!! Happy for you!

anantmulchandani
Автор

I traversed through both linked list and got the actual numbers, added them, then created a linked list with the result's digits as nodes.

mu
Автор

Couldn’t have solved this without you. Thank you so much

anthonypeters
Автор

i'm amazed at your ability. it's the nuances in the code that's the hardest to figure out. kudos to you.

passionatechristianworker
Автор

The intro slapped me back into reality. As always, thanks for the awesome explanations 😄

MrYosuko
Автор

"you probably do but you might think you don't".

Haha, thanks for the encouragement.

passionatechristianworker
Автор

"hey guys i am still unemployed so lets solve a problem" mans representing his entire audience 😂😂😂

shooby
Автор

This intro make this video my favorite one 😂. Could be a useful cue to remember the solution in an interview even.

SweVillian-mtnk
Автор

By far the best explanation of this problem I’ve seen 👏 Thanks for sharing

raymondcordero
Автор

Man I was super stressed out solving these leetcodes, but the " Hey I am still unemployed" made my day! LMAO

ishaanbhalla
Автор

Thanks for making this. Trying this problem is the first time I've ever tried using a Linked List, so this helped solidify the solution LeetCode provides.

techbrojoe
welcome to shbcf.ru