LeetCode 445——兩數相加 II

1. 題目 2. 解答 2.1 方法一 在 LeetCode 206——反轉鏈表 和 LeetCode 2——兩數相加 的基礎上,先對兩個鏈表進行反轉,然後求出和後再進行反轉即可。 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) :
相關文章
相關標籤/搜索