LeetCode #2: Add Two Numbers

preview_player
Показать описание
A step-by-step solution to #LeetCode question 2: Add Two Numbers.
0:00 Problem Explanation
1:03 Strategy Explanation
1:54 Code Walkthrough

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

Hello, thank you for the explanation. I was wandering how much practice did it take to come up with the answer?

ayushgupta
Автор

as a bigneer in python development i don't understand how did you access l1.val, l2.val and l1.next, l2.next . please help me to understand it. I am getting AttributeError: 'list' object has no attribute 'val' error on my system.

suvidhatandale
Автор

what's the point of current? why can't we use head, since they are the same address in memory anyway?
Also, what's the reason for having an empty placeholder for the head list?
and why current.next = ListNode? Isn't current a ListNode already, making next the same type?

vlchk