<filename>algorithms/1290. Convert Binary Number in a Linked List to Integer.py<gh_stars>1-10
class Solution:
    def getDecimalValue(self, head: ListNode) -> int:
        s = ''
        while head:
            s += str(head.val)
            head = head.next
        return int(s, 2)

<filename>algorithms/1290. Convert Binary Number in a Linked List to Integer.py<gh_stars>1-10
class Solution:
    def getDecimalValue(self, head: ListNode) -> int:
        s = ''
        while head:
            s += str(head.val)
            head = head.next
        return int(s, 2)
