445. Add Two Numbers II


https://leetcode.com/problems/add-two-numbers-ii/



Runtime: 21 ms, faster than 12.64% of Go online submissions for Add Two Numbers II.
Memory Usage: 6 MB, less than 8.05% of Go online submissions for Add Two Numbers II.



```go
package main

import (
	"fmt"
	"strconv"
    "math/big"
)

/*
type ListNode struct {
  Val int
  Next *ListNode
}
*/

func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
	//8:53
	number1 := ""
	node := l1
	for node != nil {
		number1 += strconv.Itoa(node.Val)
		node = node.Next
	}

	number2 := ""
	node = l2
	for node != nil {
		number2 += strconv.Itoa(node.Val)
		node = node.Next
	}

   	number_list := make([]int, 0)
    i1, _ := new(big.Int).SetString(number1, 10)
    i2, _ := new(big.Int).SetString(number2, 10)
    c := big.NewInt(int64(0))
    c.Add(i1, i2)
	for _, char := range c.Text(10) {
		val, _ := strconv.Atoi(string(char))
		number_list = append(number_list, val)
	} 
    
    /*
    fmt.Println(i1)
    fmt.Println(i2)
    fmt.Println(c.Text(10))
    */

	head := ListNode{Val: 0, Next: nil}
	node = &head
	for index, val := range number_list {
		node.Val = val
		if index != len(number_list) -1 {
            //fmt.Println(val)
			node.Next = &ListNode{Val: 0, Next: nil}
            node = node.Next
		}
	}

	return &head
	//9:03
    //debug until 9:28; the big number is static language is disgusting
}
```
