Skip to content

Commit c7e9717

Browse files
authored
Update stone-game-v.py
1 parent 9a1b02c commit c7e9717

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/stone-game-v.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def stoneGameV(self, stoneValue):
1717
dp[i][i] = stoneValue[i]
1818
p = range(n)
1919
max_score = 0
20-
for l in xrange(1, n):
21-
for i in xrange(n-l):
22-
j = i+l
20+
for l in xrange(2, n+1):
21+
for i in xrange(n-l+1):
22+
j = i+l-1
2323
while prefix[p[i]+1]-prefix[i] < prefix[j+1]-prefix[p[i]+1]:
2424
p[i] += 1
2525
max_score = 0

0 commit comments

Comments
 (0)