Skip to content

Commit be18353

Browse files
authored
Update backpack.py
1 parent 39101be commit be18353

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backpack.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# coding: utf-8
22

33
class Solution:
44
# @param m: An integer m denotes the size of a backpack
@@ -21,4 +21,6 @@ def backPack(self, m, A):
2121
for i in xrange(len(A)):
2222
for j in xrange(m, A[i] - 1, -1):
2323
capacities[j] = max(capacities[j - A[i]] + A[i], capacities[j])
24-
return capacities[-1]
24+
return capacities[-1]
25+
26+
# medium: http://lintcode.com/zh-cn/problem/backpack/

0 commit comments

Comments
 (0)