mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-04 04:02:48 +08:00
Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
This commit is contained in:
@@ -6,15 +6,15 @@ Author: krahets ([email protected])
|
||||
|
||||
|
||||
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)
|
||||
@@ -24,7 +24,7 @@ def list_to_linked_list(arr: list[int]) -> ListNode | None:
|
||||
|
||||
|
||||
def linked_list_to_list(head: ListNode | None) -> list[int]:
|
||||
"""連結リストをリストにシリアライズ"""
|
||||
"""連結リストをシリアライズしてリストにする"""
|
||||
arr: list[int] = []
|
||||
while head:
|
||||
arr.append(head.val)
|
||||
|
||||
Reference in New Issue
Block a user