diff --git a/2019/d04/ex1/ex1.py b/2019/d04/ex1/ex1.py index 460b7d8..49bb589 100755 --- a/2019/d04/ex1/ex1.py +++ b/2019/d04/ex1/ex1.py @@ -7,7 +7,7 @@ def is_valid_password(p: int) -> bool: digits = str(p) def has_adjacent_digit(): - for (a, b) in zip(digits, digits[1:]): + for a, b in zip(digits, digits[1:]): if a == b: return True return False diff --git a/2019/d04/ex2/ex2.py b/2019/d04/ex2/ex2.py index 883abf9..a54ccfe 100755 --- a/2019/d04/ex2/ex2.py +++ b/2019/d04/ex2/ex2.py @@ -8,7 +8,7 @@ def is_valid_password(p: int) -> bool: def has_unique_adjacent_digit(): counts = {d: 0 for d in range(10)} - for (a, b) in zip(digits, digits[1:]): + for a, b in zip(digits, digits[1:]): if a == b: counts[int(a)] += 1 return any(count == 1 for count in counts.values()) diff --git a/2021/d11/ex1/ex1.py b/2021/d11/ex1/ex1.py index 19669b3..619bd27 100755 --- a/2021/d11/ex1/ex1.py +++ b/2021/d11/ex1/ex1.py @@ -39,7 +39,7 @@ def solve(input: List[str]) -> int: # Second step, do flashes has_flashed: Set[Point] = set() while len(flashes := (excited(levels) - has_flashed)) > 0: - for (i, j) in flashes: + for i, j in flashes: has_flashed.add((i, j)) for x, y in neighbours_of((i, j)): levels[x][y] += 1 diff --git a/2021/d11/ex2/ex2.py b/2021/d11/ex2/ex2.py index 0dee9eb..d4ce118 100755 --- a/2021/d11/ex2/ex2.py +++ b/2021/d11/ex2/ex2.py @@ -39,7 +39,7 @@ def solve(input: List[str]) -> int: # Second step, do flashes has_flashed: Set[Point] = set() while len(flashes := (excited(levels) - has_flashed)) > 0: - for (i, j) in flashes: + for i, j in flashes: has_flashed.add((i, j)) for x, y in neighbours_of((i, j)): levels[x][y] += 1 diff --git a/2021/d12/ex1/ex1.py b/2021/d12/ex1/ex1.py index 4d0cacf..1887c7d 100755 --- a/2021/d12/ex1/ex1.py +++ b/2021/d12/ex1/ex1.py @@ -12,7 +12,7 @@ def solve(input: List[str]) -> int: def parse() -> Map: res: Map = defaultdict(set) - for (start, to) in map(lambda s: s.split("-"), input): + for start, to in map(lambda s: s.split("-"), input): res[start].add(to) res[to].add(start) diff --git a/2021/d12/ex2/ex2.py b/2021/d12/ex2/ex2.py index 69d9aa9..bc5a527 100755 --- a/2021/d12/ex2/ex2.py +++ b/2021/d12/ex2/ex2.py @@ -12,7 +12,7 @@ def solve(input: List[str]) -> int: def parse() -> Map: res: Map = defaultdict(set) - for (start, to) in map(lambda s: s.split("-"), input): + for start, to in map(lambda s: s.split("-"), input): res[start].add(to) res[to].add(start) diff --git a/2021/d25/ex1/ex1.py b/2021/d25/ex1/ex1.py index 76fbe54..6a2aef8 100755 --- a/2021/d25/ex1/ex1.py +++ b/2021/d25/ex1/ex1.py @@ -61,11 +61,11 @@ def solve(input: List[str]) -> int: for x in range(map.dimensions.x): print( "".join( - "v" - if Point(x, y) in map.south - else ">" - if Point(x, y) in map.east - else "." + ( + "v" + if Point(x, y) in map.south + else ">" if Point(x, y) in map.east else "." + ) for y in range(map.dimensions.y) ) ) diff --git a/2022/d12/ex1/ex1.py b/2022/d12/ex1/ex1.py index 9e1c372..3e78cfc 100755 --- a/2022/d12/ex1/ex1.py +++ b/2022/d12/ex1/ex1.py @@ -20,7 +20,7 @@ class HeightMap: def reachable_neighbours(self, p: Point) -> Iterator[Point]: reachable_height = self.heights[p.x][p.y] + 1 - for (dx, dy) in ((-1, 0), (1, 0), (0, -1), (0, 1)): + for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)): x, y = p.x + dx, p.y + dy if x < 0 or x >= len(self.heights): continue diff --git a/2022/d12/ex2/ex2.py b/2022/d12/ex2/ex2.py index 657f807..0a713b3 100755 --- a/2022/d12/ex2/ex2.py +++ b/2022/d12/ex2/ex2.py @@ -20,7 +20,7 @@ class HeightMap: def reachable_neighbours(self, p: Point) -> Iterator[Point]: reachable_height = self.heights[p.x][p.y] + 1 - for (dx, dy) in ((-1, 0), (1, 0), (0, -1), (0, 1)): + for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)): x, y = p.x + dx, p.y + dy if x < 0 or x >= len(self.heights): continue diff --git a/flake.lock b/flake.lock index ffbe623..d2cf81b 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701336116, - "narHash": "sha256-kEmpezCR/FpITc6yMbAh4WrOCiT2zg5pSjnKrq51h5Y=", + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5c27c6136db4d76c30e533c20517df6864c46ee", + "rev": "5083ec887760adfe12af64830a66807423a859a7", "type": "github" }, "original": { @@ -75,9 +75,6 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": [ - "futils" - ], "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -87,11 +84,11 @@ ] }, "locked": { - "lastModified": 1700922917, - "narHash": "sha256-ej2fch/T584b5K9sk1UhmZF7W6wEfDHuoUYpFN8dtvM=", + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e5ee5c5f3844550c01d2131096c7271cec5e9b78", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6334931..36616f8 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,6 @@ repo = "pre-commit-hooks.nix"; ref = "master"; inputs = { - flake-utils.follows = "futils"; nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; };