Skip to content

Commit 39101be

Browse files
authored
Update backpack_ii.py
1 parent 6d002ba commit 39101be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backpack_ii.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
@@ -18,4 +18,6 @@ def backPackII(self, m, A, V):
1818
for j in xrange(m, -1, -1):
1919
if j >= A[i]: # 有足够的体积容纳第i件商品
2020
ret[j] = max(ret[j], ret[j - A[i]] + V[i])
21-
return ret[-1]
21+
return ret[-1]
22+
23+
# medium: http://lintcode.com/zh-cn/problem/backpack-ii/

0 commit comments

Comments
 (0)