You are given two non empty singly linked lists l1 and l2 that represent two non negative integers. Each node stores a single digit in Node.val, and the digits are ordered from most significant to least significant.
Return the sum of the two numbers as a singly linked list in the same most significant to least significant digit order.
Note: Follow up: can you solve this without reversing the input lists?
Constraints:
The number of nodes in each of l1 and l2 is in the range
Node.val
Each list represents a number with no leading zeros.
You are given two non empty singly linked lists l1 and l2 that represent two non negative integers. Each node stores a single digit in Node.val, and the digits are ordered from most significant to least significant.
Return the sum of the two numbers as a singly linked list in the same most significant to least significant digit order.
Note: Follow up: can you solve this without reversing the input lists?
Constraints:
The number of nodes in each of l1 and l2 is in the range
Node.val
Each list represents a number with no leading zeros.