mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Enable ruff RUF005 rule (#11344)
This commit is contained in:
@ -45,7 +45,7 @@ def subset_combinations(elements: list[int], n: int) -> list:
|
||||
for i in range(1, r + 1):
|
||||
for j in range(i, 0, -1):
|
||||
for prev_combination in dp[j - 1]:
|
||||
dp[j].append(tuple(prev_combination) + (elements[i - 1],))
|
||||
dp[j].append((*prev_combination, elements[i - 1]))
|
||||
|
||||
try:
|
||||
return sorted(dp[n])
|
||||
|
Reference in New Issue
Block a user