Enable ruff RUF005 rule (#11344)

This commit is contained in:
Maxim Smolskiy
2024-04-02 22:18:47 +03:00
committed by GitHub
parent f437f92279
commit f5bbea3776
4 changed files with 7 additions and 4 deletions

View File

@ -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])