AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
74
var assert = require('assert');
/*
* @param {LinkedListNode} list1
* @param {LinkedListNode} list2
* @return {LinkedListNode}
*/
function addLLNums(list1, list2) {
// add list1 and list2
return result;
}
function LinkedListNode(val) {
this.val = val;
this.next = null;
}
var list1 = new LinkedListNode(3);
var nodes1 = [4, 5, 6, 7, 8, 9, 9];
createNodes(list1, nodes1);
var list2 = new LinkedListNode(1);
var nodes2 = [2, 3, 4, 5, 6, 7, 8];
createNodes(list2, nodes2);
var list3 = new LinkedListNode(1);
OUTPUT
Results will appear here.