Add two linked listsEasy
Let's say you're given two linked lists that each represent a number.
For example, the linked list
(1) -> (3) -> (4) -> (7)represents the number
Write a function that adds the two input numbers represented by linked lists, and returns the sum represented by a linked list.
Note that the first node is the most significant digit, and the last node is the least significant digit.
For example, a function that's passed these inputs:
(1) -> (4) -> (7)(2) -> (3)
(1) -> (7) -> (0)