Imagine you have a giant number so large that it can't fit in a regular integer variable - maybe it has hundreds of digits! This number is stored as a linked list, where each node contains a single digit, and the digits are arranged from most significant to least significant (left to right).
Your task is to double this enormous number and return the result as a linked list in the same format. The input is guaranteed to represent a non-negative integer without leading zeros.
Example: If the linked list represents 123, after doubling it should represent 246.
Think of it like using an old-fashioned calculator that can only display one digit at a time, but you need to double a number that's way too big for any calculator!
Input & Output
Constraints
- The number of nodes in the list is in the range [1, 104]
- 0 โค Node.val โค 9
- The input represents a valid number without leading zeros
- The linked list represents a non-negative integer