Solución
solution.tsTypeScript
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
return Vector(self.x+other.x, self.y + other.y)
def add_vectors(v1, v2):
a = Vector(v1[0], v1[1])
b = Vector(v2[0], v2[1])
result = a + b
return [result.x, result.y]
0respuestas