mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-12 23:52:17 +08:00
Enable ruff SIM102 rule (#11341)
* Enable ruff SIM102 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -92,10 +92,9 @@ def eliminate(values, s, d):
|
||||
dplaces = [s for s in u if d in values[s]]
|
||||
if len(dplaces) == 0:
|
||||
return False ## Contradiction: no place for this value
|
||||
elif len(dplaces) == 1:
|
||||
# d can only be in one place in unit; assign it there
|
||||
if not assign(values, dplaces[0], d):
|
||||
return False
|
||||
# d can only be in one place in unit; assign it there
|
||||
elif len(dplaces) == 1 and not assign(values, dplaces[0], d):
|
||||
return False
|
||||
return values
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user