sum_elements_in_LL_recursive
问题:
class ListNode {
constructor(value = 0, next = null) {
this.value = value
this.next = next
}
}
function sumElements(head) {
return -1
}
// Test Cases
var LL1 = new ListNode(1, new ListNode(4, new ListNode(5)))
console.log(sumElements(null)) // 0
console.log(sumElements(LL1)) // 10
console.log(sumElements(new ListNode(1))) // 1