Double the non-negative integer stored in a linked list of digits and return the resulting list.
You are given the head of a singly linked list where each node contains a single decimal digit. The digits represent a non-negative integer in forward order, with the most significant digit at the head.
Return the head of a linked list representing the number obtained by doubling the original value.
The returned list should also store digits in forward order. If doubling creates a new most significant digit, include it in the result.
head, where each node contains one digit 0 through 9.2 × value(head) in forward order.0 to 9.Example 1
Input
head = [1,8,9]
Output
[3,7,8]
Explanation
189 doubled is 378, so the resulting linked list is [3,7,8].
Example 2
Input
head = [9,9,9]
Output
[1,9,9,8]
Explanation
999 doubled is 1998, which requires an extra leading digit.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.