You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
(2 -> 4 -> 3) +
(5 -> 6 -> 4)
7 -> 0 -> 8
342 + 465 = 807
Make sure there are no trailing zeros in the output list
7 -> 0 -> 8 -> 0 is not a valid response even though the value is still 807.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.