[pre-commit.ci] pre-commit autoupdate (#11275)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0)

* Upgrade pyproject.toml

* Revert sudoku_solver.py RUF017 Avoid quadratic list summation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
pre-commit-ci[bot]
2024-02-05 20:48:10 +01:00
committed by GitHub
parent 4128f19170
commit ed8d9209da
11 changed files with 25 additions and 39 deletions

View File

@ -22,7 +22,7 @@ unitlist = (
+ [cross(rs, cs) for rs in ("ABC", "DEF", "GHI") for cs in ("123", "456", "789")]
)
units = {s: [u for u in unitlist if s in u] for s in squares}
peers = {s: set(sum(units[s], [])) - {s} for s in squares}
peers = {s: set(sum(units[s], [])) - {s} for s in squares} # noqa: RUF017
def test():

View File

@ -171,11 +171,9 @@ def is_palindrome_dict(head: ListNode | None) -> bool:
if len(v) % 2 != 0:
middle += 1
else:
step = 0
for i in range(len(v)):
for step, i in enumerate(range(len(v))):
if v[i] + v[len(v) - 1 - step] != checksum:
return False
step += 1
if middle > 1:
return False
return True