Linked List
1290. Convert Binary Number in a Linked List to Integer
A linked list of bits (most-significant first) represents a binary number; return its decimal value. Build the number streaming head-to-tail: res = 2·res + bit. By the time you reach the end, res is…
Loading…