[問題] leetcode 23
https://leetcode.com/problems/merge-k-sorted-lists/description/
my code
https://paste.ubuntu.com/p/MBqn88Z78b/
選python2 可以過
python3出現下面錯誤
Line 18: TypeError: unorderable types: ListNode() < ListNode()
根據python3 doc
https://docs.python.org/3/library/heapq.html#basic-examples
python2 vs python3 heapq都用tuple第一個元素來當作比較,
而我也將itm[0]放了int
請問我的python3問題在哪呢?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 8.41.187.50
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1535481281.A.68D.html
※ 編輯: sean72 (8.41.187.50), 08/29/2018 02:37:02
→
08/29 08:17,
6年前
, 1F
08/29 08:17, 1F
→
08/29 08:23,
6年前
, 2F
08/29 08:23, 2F
推
08/29 10:35,
6年前
, 3F
08/29 10:35, 3F
推
08/29 10:59,
6年前
, 4F
08/29 10:59, 4F
Python 近期熱門文章
PTT數位生活區 即時熱門文章