Skip to content

Commit

Permalink
day7
Browse files Browse the repository at this point in the history
  • Loading branch information
Stegallo committed Nov 14, 2023
1 parent 723cffa commit 16537a1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions y_2015/day7.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ class Operator:
class Element:
source: str
operator: Optional[Operator] = None

result: int = 0
result_valid: bool = False

def __post_init__(self) -> None:
if any(o in self.source for o in list(OPERATORS.keys())):
for i in list(OPERATORS.keys()):
if i in self.source:
self.operator = Operator(
i,
[x for x in self.source.replace(" ", "").split(i) if x],
)
for i in list(OPERATORS.keys()):
if i in self.source:
self.operator = Operator(
i,
[x for x in self.source.replace(" ", "").split(i) if x],
)

def resolve(self, wires) -> int:
if self.result_valid:
Expand Down

0 comments on commit 16537a1

Please sign in to comment.