Skip to content

Commit 362d2a5

Browse files
authored
Update coins_in_a_line_ii.py
1 parent 78464d7 commit 362d2a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

coins_in_a_line_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 values: a list of integers
@@ -18,4 +18,6 @@ def firstWillWin(self, values):
1818
score[i] = values[i] + min(score[i + 2], score[i + 3])
1919
# 拿2个后,对方取1个或2个的情况。
2020
score[i] = max(score[i], values[i] + values[i + 1] + min(score[i + 3], score[i + 4]))
21-
return True if score[0] > (sum(values) - score[0]) else False
21+
return True if score[0] > (sum(values) - score[0]) else False
22+
23+
# medium: http://lintcode.com/zh-cn/problem/coins-in-a-line-ii/

0 commit comments

Comments
 (0)