LinkedList1 [Leetcode][Javascript][Medium] 2. Add Two Numbers /** * https://leetcode.com/problems/add-two-numbers/ * * Definition for singly-linked list. * function ListNode(val, next) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } */ /** * @param {ListNode} l1 * @param {ListNode} l2 * @return {ListNode} */ var addTwoNumbers = function(l1, l2) { var carry = 0; var n1 = l1, n2 = l2; var answerNode = new ListNod.. 2021. 7. 2. 이전 1 다음