func addLists(l1, l2 *list.List) *list.List {
	l := list.New()
	lenMax := max(l1.Len(), l2.Len())
	e1, e2 := l1.Front(), l2.Front()
	for i, carry := 0, 0; i < lenMax || carry == 1; i++ {
		v1, v2 := 0, 0
		if i < l1.Len() {
			v1 = e1.Value
		}
		if i < l2.Len() {
			v2 = e2.Value
		}
		var val int
		carry, val = divmod(v1+v2+carry, 10)
		l.PushBack(val)
		e1, e2 = e1.Next, e2.Next
	}
	return l
}
// addLists solves problem 2.5

addLists solves problem 2.5
// addLists solves problem 2 . 5
func addLists(l1, l2 *list.List) *list.List {
	l := list.New()
	lenMax := max(l1.Len(), l2.Len())
	e1, e2 := l1.Front(), l2.Front()
	for i, carry := 0, 0; i < lenMax || carry == 1; i++ {
		v1, v2 := 0, 0
		if i < l1.Len() {
			v1 = e1.Value
		}
		if i < l2.Len() {
			v2 = e2.Value
		}
		var val int
		carry, val = divmod(v1+v2+carry, 10)
		l.PushBack(val)
		e1, e2 = e1.Next, e2.Next
	}
	return l
}
func addLists ( l1 , l2 * list . List ) * list . List { l := list . New ( ) lenMax := max ( l1 . Len ( ) , l2 . Len ( ) ) e1 , e2 := l1 . Front ( ) , l2 . Front ( ) for i , carry := 0 , 0 ; i < lenMax || carry == 1 ; i ++ { v1 , v2 := 0 , 0 if i < l1 . Len ( ) { v1 = e1 . Value } if i < l2 . Len ( ) { v2 = e2 . Value } var val int carry , val = divmod ( v1 + v2 + carry , 10 ) l . PushBack ( val ) e1 , e2 = e1 . Next , e2 . Next } return l }
addLists solves problem 2.5
addLists solves problem 2 . 5