Update minimum_partition.py

The loop for finding differences had issues of float being iterated. Has been fixed.
This commit is contained in:
Sayan Bandyopadhyay 2017-10-12 03:28:43 +05:30 committed by GitHub
parent f9156cfb71
commit 247089decc

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;