📅  最后修改于: 2022-03-11 15:04:18.193000             🧑  作者: Mango
class Solution:
def getDecimalValue(self, head: ListNode) -> int:
num = head.val
while head.next:
num = (num << 1) | head.next.val
head = head.next
return num