mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-16 23:27:59 +08:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -6,15 +6,15 @@ Author: krahets (krahets@163.com)
|
||||
|
||||
|
||||
class ListNode:
|
||||
"""連結リストのノードクラス"""
|
||||
"""連結リストノードクラス"""
|
||||
|
||||
def __init__(self, val: int):
|
||||
self.val: int = val # ノードの値
|
||||
self.val: int = val # ノード値
|
||||
self.next: ListNode | None = None # 後続ノードへの参照
|
||||
|
||||
|
||||
def list_to_linked_list(arr: list[int]) -> ListNode | None:
|
||||
"""リストを連結リストにデシリアライズ"""
|
||||
"""リストを連結リストにデシリアライズする"""
|
||||
dum = head = ListNode(0)
|
||||
for a in arr:
|
||||
node = ListNode(a)
|
||||
@@ -29,4 +29,4 @@ def linked_list_to_list(head: ListNode | None) -> list[int]:
|
||||
while head:
|
||||
arr.append(head.val)
|
||||
head = head.next
|
||||
return arr
|
||||
return arr
|
||||
|
||||
Reference in New Issue
Block a user