mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 14:43:43 +00:00
Merge pull request #158 from Sayan97/patch-3
Update minimum_partition.py
This commit is contained in:
commit
f0addfb2f3
|
@ -20,7 +20,7 @@ def findMin(arr):
|
||||||
if (arr[i-1] <= j):
|
if (arr[i-1] <= j):
|
||||||
dp[i][j] = dp[i][j] or dp[i-1][j-arr[i-1]]
|
dp[i][j] = dp[i][j] or dp[i-1][j-arr[i-1]]
|
||||||
|
|
||||||
for j in range(s/2, -1, -1):
|
for j in range(int(s/2), -1, -1):
|
||||||
if dp[n][j] == True:
|
if dp[n][j] == True:
|
||||||
diff = s-2*j
|
diff = s-2*j
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user