Merge pull request #158 from Sayan97/patch-3

Update minimum_partition.py
This commit is contained in:
Harshil 2017-11-28 17:06:16 +05:30 committed by GitHub
commit f0addfb2f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ def findMin(arr):
if (arr[i-1] <= j):
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:
diff = s-2*j
break;