day16 - no need dataclass -> 180ms/1m17s

This commit is contained in:
Stefan Harmuth 2022-12-16 16:05:31 +01:00
parent f739d6cf74
commit 2966e26c44

View File

@ -1,5 +1,4 @@
from collections import deque
from dataclasses import dataclass
from itertools import product
from tools.aoc import AOCDay
from typing import Any
@ -12,10 +11,10 @@ class Valve:
self.tunnels: set = set()
@dataclass(frozen=True)
class Tunnel:
target: Valve
length: int = 1
def __init__(self, target: Valve, length: int = 1):
self.target: Valve = target
self.length: int = length
def __str__(self):
return f"Tunnel(target={self.target.name}, length={self.length})"