Skip to content

Commit

Permalink
Update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
KajaBraz authored Dec 3, 2024
1 parent 13a402f commit ec70122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions day03/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def solve_part_2_v2(data: str) -> int:


def remove_disabled(data):
no_spaces = re.sub(r'\s+', '', data)
enabled_only = re.sub(r"don't\(\).+?do\(\)|don't\(\).+$", '', no_spaces)
one_line_data = re.sub(r'\n', '', data)
enabled_only = re.sub(r"don't\(\).+?do\(\)|don't\(\).+$", '', one_line_data)
return enabled_only


Expand Down

0 comments on commit ec70122

Please sign in to comment.