Skip to content

Commit 0c3b8ca

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d42eafd commit 0c3b8ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dynamic_programming/combination_sum_iv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ def count_of_possible_combinations_with_dp_array(
6060
return 1
6161
if dp_array[target] != -1:
6262
return dp_array[target]
63-
answer = sum([count_of_possible_combinations_with_dp_array(target - each, dp_array) for each in array])
63+
answer = sum(
64+
[
65+
count_of_possible_combinations_with_dp_array(target - each, dp_array)
66+
for each in array
67+
]
68+
)
6469
dp_array[target] = answer
6570
return answer
6671

0 commit comments

Comments
 (0)