Re: [閒聊] 每日leetcode
勝這種題目能給我一點信心了
一二三四五
def getDecimalValue(self, head: Optional[ListNode]) -> int:
ans = 0
while head:
ans = ans*2 + head.val
head = head.next
return ans
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.58.28 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1752505756.A.305.html
推
07/14 23:11,
4月前
, 1F
07/14 23:11, 1F
推
07/14 23:13,
4月前
, 2F
07/14 23:13, 2F
討論串 (同標題文章)
完整討論串 (本文為第 1466 之 1548 篇):