MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / depthFirstNum

Function depthFirstNum

add_two_numbers_2/solution.go:50–57  ·  view source on GitHub ↗
(l *structures.ListNode)

Source from the content-addressed store, hash-verified

48}
49
50func depthFirstNum(l *structures.ListNode) *big.Int {
51 if l == nil {
52 return big.NewInt(0)
53 }
54
55 v := depthFirstNum(l.Next)
56 return v.Mul(v, big.NewInt(10)).Add(v, big.NewInt(int64(l.Val)))
57}
58
59func addTwoNumbers2(l1 *structures.ListNode, l2 *structures.ListNode) *structures.ListNode {
60 carry := 0

Callers 1

addTwoNumbersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected