Skip to content

Commit 04b1b69

Browse files
authored
Update maximum-and-sum-of-array.py
1 parent 3e71332 commit 04b1b69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/maximum-and-sum-of-array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def maximumANDSum(self, nums, numSlots):
6767
:rtype: int
6868
"""
6969
adj = [[-((nums[i] if i < len(nums) else 0) & (1+x//2)) for x in xrange(2*numSlots)] for i in xrange(2*numSlots)]
70-
return -sum(adj[r][c] for r, c in itertools.izip(*hungarian(adj)))
70+
return -sum(adj[i][j] for i, j in itertools.izip(*hungarian(adj)))
7171

7272

7373
# Time: O(n * 3^n)

0 commit comments

Comments
 (0)