2. Add Two Numbers - Day 12/31 Leetcode January Challenge

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

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

Were you able to add two numbers quickly?

Algorithmist
Автор

I had already seen this problem before, so I was able to get the solution pretty quickly. However, when initializing my head, I made it ListNode(0) instead of ListNode(-1). Are there any edge cases where this wouldn't work or any reason to use -1 over 0? It passed all of LeetCode's testcases.

noahf
visit shbcf.ru