mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-08 18:30:07 +08:00
* 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
21 lines
529 B
Python
21 lines
529 B
Python
# File: vertex.py
|
|
# Created Time: 2023-02-23
|
|
# Author: krahets (krahets@163.com)
|
|
|
|
|
|
class Vertex:
|
|
"""頂点クラス"""
|
|
|
|
def __init__(self, val: int):
|
|
self.val = val
|
|
|
|
|
|
def vals_to_vets(vals: list[int]) -> list["Vertex"]:
|
|
"""値のリスト vals を入力し、頂点のリスト vets を返す"""
|
|
return [Vertex(val) for val in vals]
|
|
|
|
|
|
def vets_to_vals(vets: list["Vertex"]) -> list[int]:
|
|
"""頂点のリスト vets を入力し、値のリスト vals を返す"""
|
|
return [vet.val for vet in vets]
|