Solved LeetCode program · 927 of 1,000
#1290 · Convert Binary Number in a Linked List to Integer
Original English source
The values is a list of 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, and 0. The nexts is a list of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and -1. The answer is 0. The node is 0.
Repeat while node is at least 0.
Set answer to answer times 2 plus item node of values. Set node to item node of nexts.
Show answer.
Expected stdout
18880