Setup
Backlinks (0)
No backlinks found.
# Definition for singly-linked list.# class ListNode:# def __init__(self, val=0, next=None):# self.val = val# self.next = nextclass Solution: def getDecimalValue(self, head: ListNode) -> int: value = head.val while head.next: value *= 2 head = head.next value += head.val return value